문제

I am trying to get IMEI of a phone by running this android code

String imei="*#06#";//Checking the Phone's IMEI.
Intent cintent= new Intent(Intent.ACTION_CALL, Uri.parse("tel:"+Uri.encode(imei)));
startActivity(cintent);

I have set the permission as required

  <uses-permission android:name="android.permission.CALL_PHONE"/>

But am getting this feedback on my phone "Connection problem or invalid MMI code". Where did I go wrong? Thanks

도움이 되었습니까?

해결책

A simple change of this line did the magic. From

    Intent.ACTION_CALL 

TO:

    Intent.ACTION_DIAL

Thanks

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top