-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotedetail.java
More file actions
56 lines (47 loc) · 1.98 KB
/
notedetail.java
File metadata and controls
56 lines (47 loc) · 1.98 KB
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
46
47
48
49
50
51
52
53
54
55
56
package com.example.notesapp;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import androidx.appcompat.widget.Toolbar;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import org.w3c.dom.Text;
public class notedetail extends AppCompatActivity {
private TextView mtitlenotedetail , mcontenttextofdetail;
FloatingActionButton detailfab;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_notedetail);
mtitlenotedetail=findViewById(R.id.textView2);
mcontenttextofdetail=findViewById(R.id.contenttextofdetail);
detailfab=findViewById(R.id.gotoedit);
Toolbar toolbar = findViewById(R.id.toolbarofnotedetail);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Intent data = new Intent();
detailfab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(view.getContext(),editnoteactivity.class);
intent.putExtra("title",data.getStringExtra("title"));
intent.putExtra("content",data.getStringExtra("content"));
intent.putExtra("noteId",data.getStringExtra("noteId"));
view.getContext().startActivity(intent);
}
});
mcontenttextofdetail.setText(data.getStringExtra("content"));
mtitlenotedetail.setText(data.getStringExtra("title"));
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if (item.getItemId()==android.R.id.home){
onBackPressed();
}
return super.onOptionsItemSelected(item);
}
}