-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditScreen.java
45 lines (33 loc) · 1.35 KB
/
editScreen.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.example.ya_.myapplication;
/*summber:https://github.com/itb-prd/membuat-aplikasi-android-dasar-yonasadiel*/
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
public class editScreen extends AppCompatActivity{
Intent lastIntent;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.edit_layout);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
lastIntent = getIntent();
EditText newNameET = (EditText) findViewById(R.id.new_name_list);
newNameET.setText(lastIntent.getExtras().getString("Name of ToDoList"));
}
public void onSendNewTaskName(View view) {
EditText newNameET = (EditText) findViewById(R.id.new_name_list);
String newName = String.valueOf(newNameET.getText());
int index = lastIntent.getExtras().getInt("Index of ToDoList");
Intent goBack = new Intent();
goBack.putExtra("New Name",newName);
goBack.putExtra("Index of ToDoList",index);
setResult(RESULT_OK, goBack);
finish();
}
}