mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-23 03:50:07 +01:00
create a notepicker dialog
This commit is contained in:
parent
4102800975
commit
371ee198e0
@ -150,7 +150,22 @@ public class MainActivity extends SimpleActivity {
|
||||
}
|
||||
|
||||
private void displayOpenNoteDialog() {
|
||||
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(getResources().getString(R.string.pick_a_note));
|
||||
|
||||
final int cnt = mNotes.size();
|
||||
String[] notes = new String[cnt];
|
||||
for (int i = 0; i < cnt; i++) {
|
||||
notes[i] = mNotes.get(i).getTitle();
|
||||
}
|
||||
|
||||
builder.setItems(notes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
}
|
||||
});
|
||||
builder.show();
|
||||
}
|
||||
|
||||
private void saveText() {
|
||||
|
@ -94,7 +94,7 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
public List<Note> getNotes() {
|
||||
final List<Note> notes = new ArrayList<>();
|
||||
final String cols[] = {COL_ID, COL_TITLE, COL_VALUE};
|
||||
final Cursor cursor = mDb.query(TABLE_NAME, cols, null, null, null, null, null);
|
||||
final Cursor cursor = mDb.query(TABLE_NAME, cols, null, null, null, null, COL_TITLE);
|
||||
if (cursor != null) {
|
||||
if (cursor.moveToFirst()) {
|
||||
do {
|
||||
|
@ -17,6 +17,7 @@
|
||||
<string name="delete_note">Delete note</string>
|
||||
<string name="delete_note_prompt_title">Delete note</string>
|
||||
<string name="delete_note_prompt_message">Are you sure you want to delete note \"%1$s\"?</string>
|
||||
<string name="pick_a_note">Pick a note</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="settings">Einstellungen</string>
|
||||
|
@ -17,6 +17,7 @@
|
||||
<string name="delete_note">Delete note</string>
|
||||
<string name="delete_note_prompt_title">Delete note</string>
|
||||
<string name="delete_note_prompt_message">Are you sure you want to delete note \"%1$s\"?</string>
|
||||
<string name="pick_a_note">Pick a note</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="settings">Impostazioni</string>
|
||||
|
@ -17,6 +17,7 @@
|
||||
<string name="delete_note">Delete note</string>
|
||||
<string name="delete_note_prompt_title">Delete note</string>
|
||||
<string name="delete_note_prompt_message">Are you sure you want to delete note \"%1$s\"?</string>
|
||||
<string name="pick_a_note">Pick a note</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="settings">設定</string>
|
||||
|
@ -17,6 +17,7 @@
|
||||
<string name="delete_note">Delete note</string>
|
||||
<string name="delete_note_prompt_title">Delete note</string>
|
||||
<string name="delete_note_prompt_message">Are you sure you want to delete note \"%1$s\"?</string>
|
||||
<string name="pick_a_note">Pick a note</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="settings">Inställningar</string>
|
||||
|
@ -17,6 +17,7 @@
|
||||
<string name="delete_note">Delete note</string>
|
||||
<string name="delete_note_prompt_title">Delete note</string>
|
||||
<string name="delete_note_prompt_message">Are you sure you want to delete note \"%1$s\"?</string>
|
||||
<string name="pick_a_note">Pick a note</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="settings">Settings</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user