Android.permission.PHONE_CALL is added as a manifest but still has an …

I’m trying to use ACTION_CALL intent for calling a USSD code. I have added the android.permission.PHONE_CALL to the manifest file but it doesn’t work and get the permission error exception. PS: as you see there are also permissions for GPS and INTERNET and they works fine. Here are the codes:

public void onClick(View v) {
    String encodedHash = Uri.encode("#");
    String number = "*140*1";
    Intent intent = new Intent(Intent.ACTION_CALL);
    intent.setData(Uri.parse("tel:" + number + encodedHash));
    } catch(Exception ex){
        Toast.makeText(getApplication(), ex.toString(), Toast.LENGTH_LONG).show();




        <activity .......
Hello, buddy!稿源:Hello, buddy! (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 移动开发 » Android&period;permission&period;PHONE&lowbar;CALL is added as a manifest but still has an …

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录