私はアンドロイドが初めてで、テキストを入力できるアプリケーションを作成しようとしています。「送信」ボタンをクリックすると、「レシーバー」という名前の別のアクティビティに送信され、アクティビティレシーバーが開くと、 edittext に入力したテキスト、
私の問題は、入力した最後のエントリの行 ID を取得して、自動的に表示されるか、テキストフィールドを使用せずに手動で行 ID を取得する方法です。
これが私のコードです。
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.project_main);
try {
String s = "1";
long l = Long.parseLong(s);
DatabasePM amem = new DatabasePM(this);
amem.open();
String returnedName = amem.getNotif(l);
amem.close();
Dialog d = new Dialog(this);
d.setTitle("Notification!");
TextView tv = new TextView(this);
tv.setText(""+returnedName);
d.setContentView(tv);
d.show();
}