문제

Once again I'm stumped... The following code works fine in the Android 2.2 emulator from the SDK and on my Galaxy Nexus (running 4.0.1) but I get a NPE when running the app on Xoom (Android 3.2).

    final TextView resNum = (TextView) findViewById(R.id.resNum);
    System.out.println(resNum);
    resNum.setOnClickListener(new View.OnClickListener() {
        String num = resNum.getText().toString();
        public void onClick(View v) {
            Intent callIntent = new Intent(Intent.ACTION_DIAL);
            callIntent.setData(Uri.parse("tel:" + num));
            startActivity(callIntent);
        }
    });

The above is in the onCreate method (among other things of course).

The NPE occurs when performing a 'read' op on resNum, i.e. the println().

Thanks

도움이 되었습니까?

해결책

The dialer is not available on Xoom. You can find more details in this article.

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