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
Post a Comment