trace a crash case and add workaround; modify translations

This commit is contained in:
houxg
2016-12-28 14:29:21 +08:00
parent 5c9a3abc0b
commit 9183f62f65
3 changed files with 11 additions and 4 deletions

View File

@@ -11,6 +11,8 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import com.tencent.bugly.crashreport.CrashReport;
import org.houxg.leamonax.BuildConfig;
import org.houxg.leamonax.R;
import org.houxg.leamonax.database.AppDataBase;
@@ -48,8 +50,6 @@ public class NotePreviewActivity extends BaseActivity implements EditorFragment.
@BindView(R.id.tv_revert)
View mRevertBtn;
private ProgressDialog mProgressDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -58,7 +58,12 @@ public class NotePreviewActivity extends BaseActivity implements EditorFragment.
initToolBar((Toolbar) findViewById(R.id.toolbar), true);
long noteLocalId = getIntent().getLongExtra(EXT_NOTE_LOCAL_ID, -1);
mNote = AppDataBase.getNoteByLocalId(noteLocalId);
if (mNote == null) {
ToastUtils.show(this, R.string.note_not_found);
CrashReport.postCatchedException(new IllegalStateException("Note not found while preview, localId=" + noteLocalId));
finish();
return;
}
mEditorFragment = EditorFragment.getNewInstance(mNote.isMarkDown(), false);
getSupportFragmentManager().beginTransaction().add(R.id.container, mEditorFragment).commit();
}

View File

@@ -75,4 +75,5 @@
<string name="about">关于</string>
<string name="feedback">反馈</string>
<string name="sign_up">注册</string>
<string name="note_not_found">找不到该笔记,请重试</string>
</resources>

View File

@@ -31,7 +31,7 @@
<string name="delete_note_failed">Delete note failed</string>
<string name="email_or_password_incorrect">Email or password is incorrect</string>
<string name="network_error">Network error</string>
<string name="untitled" translatable="false">Untitled</string>
<string name="untitled">Untitled</string>
<string name="time_yesterday">Yesterday %s</string>
<string name="use_leanote_host">Use Leanote.com</string>
<string name="use_custom_host">Use custom host</string>
@@ -74,4 +74,5 @@
<string name="select_notebook">Select notebook</string>
<string name="feedback">Feedback</string>
<string name="sign_up">Sign up</string>
<string name="note_not_found">Note not found, please try again</string>
</resources>