get the value from Intent of android -


thanks in advance. when print log.d("me",getintent().tostring());

i getting:

intent { act=android.intent.action.call_privileged dat=tel:888 flg=0x13800000 cmp=com.ninetology.freecall.two/.callfinalactivity }

i trying fetch value associated "dat" getting nullpointer exception.

//the code using getintent().getstringextra("dat"); // no use //i tried  getintent().getextras("dat").tostring(); // nullpointer exception 

i tried "tel" key in above code still no use.

it seems you're doing wrong.

  1. the getextras() function returns bundle can extract data , not function returns specific string.

  2. dat not string value can see data printed. it's uri,

try parsing should , i'm sure you'll able data.

public void oncreate(bundle b) { //mistyped     super.oncreate(b);     uri data = getintent().getdata();     // or use     string data = getintent().getdatastring();     // stuff } 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -