jakebonk / NotifyMe

A Android Library for persistent and time based notifications
Apache License 2.0
121 stars 27 forks source link

Cant fetch data using intent #5

Open hannani17 opened 5 years ago

hannani17 commented 5 years ago

I have write this intent in Preset.java, so when i click the "click here to listen"..it should go to ReceiverLayout.java class and I want to show something I fetch which is an audio filename.

Intent intent = new Intent(this,ReceiverLayout.class); intent.putExtra("filename",11111);

    NotifyMe notifyMe=new NotifyMe.Builder(getApplicationContext())
            .title(etTitle.getText().toString())
            .content(etContent.getText().toString())
            .color(255,0,0,255)
            .led_color(255,255,255,255)
            .time(cal)
            .large_icon(R.mipmap.ic_launcher_round)
            .addAction(**intent**,"Click here to listen")
            .build();

So, it works. After clicking, it brings me to ReceiverLayout xml file but the function(fetching data intent) to fetch the audio file in my project is not working. Passing is done, fetching is done so I want fetch again. But cannot since using notifyMe library functions. This is the intent to fetch my filename in ReceiverLayout.java which I said it doesnt want to work

public class ReceiverLayout extends AppCompatActivity { TextView etContent2; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_receiver_layout); etContent2 = findViewById(R.id.etContent2);

    Intent intent2 = getIntent();
    String filename = intent2.getStringExtra("file name");
    etContent2.setText(filename);
hannani17 commented 5 years ago

What I mean by passing is done, fetchcing is done is in different class which is Recording.java ..and i fetch in preset.java as I wished and it works. But since using NotifyMe..fetching intent is not working