Android getIntent() can't find my String -


i have usual intent 1 activity other , give second activity path file needed.

activity one: private void onfileclick(int position) {     file file =new file(folder+ "/"+ getlistadapter().getitem(position).tostring());      intent = new intent(this, (activity two).class); log.e("given file",file.tostring()); i.putextra(file.tostring(), key); startactivity(i); }  activity two:  @override protected void oncreate(bundle savedinstancestate) {     intent = getintent(); string filepath = i.getstringextra((activity one).key); //returns null file parsefile = new file(filepath); //nullpointerexeption } 

have initialized intent wrong?


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -