0

HTC One で問題が発生すると思われるアプリをアプリ ストアでリリースしました。アプリが開かれるとすぐに、アプリは電話をかけるためのインテント ACTION_CALL を実行します。呼び出しの意図がありますが、ボタンを押して位置情報サービスにアクセスし、5 秒間 sleep() を呼び出した後にアクセスされます。しかし、HTC Sense を使用すると、レイアウトを表示することさえせずに、通話に直接アクセスできます。4.3 を実行している Galaxy S3 があり、アプリのターゲット SDK は 19 で、アプリは問題なく動作しています。

なぜこうなった?HTC Sense のインテントの呼び出しに問題はありますか? HTC Senseデバイスの場合、signalHandlerのようなもので、インテントの発生を止める方法はありますか?

HTC センス 5.0、ア​​ンドロイド: 4.3

コード (電話インテントを呼び出すアクティビティ):

protected void onCreate(Bundle paramBundle) {
    super.onCreate(paramBundle);
    setContentView(R.layout.activity_test);
    x=9;
    final TextView localTextView = (TextView) findViewById(R.id.addr);
    LocationManager localLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    localLocationManager.getLastKnownLocation("gps");
    localLocationManager.requestLocationUpdates("gps", 2000L, 10.0F, new LocationListener() {
        public void onLocationChanged(Location paramAnonymousLocation) {
            double d1 = paramAnonymousLocation.getLatitude();
            double d2 = paramAnonymousLocation.getLongitude();
            Geocoder localGeocoder = new Geocoder(Test.this.getApplicationContext(), Locale.getDefault());
            try {
                List localList = localGeocoder.getFromLocation(d1, d2, 1);
                if (localList.size() == 1) {
                    Address localAddress = (Address) localList.get(0);
                    Object[] arrayOfObject = new Object[3];
                    if (localAddress.getMaxAddressLineIndex() > 0) ;
                    for (String str1 = localAddress.getAddressLine(0); ; str1 = "") {
                        arrayOfObject[0] = str1;
                        arrayOfObject[1] = localAddress.getAddressLine(1);
                        arrayOfObject[2] = localAddress.getCountryName();
                        String str2 = String.format("%s, %s, %s", arrayOfObject);
                        localTextView.setText(str2);
                        if(x==9){
                        Test.this.waititout();}
                        return;
                    }
                }
            } catch (IOException localIOException) {
                localIOException.printStackTrace();
                return;
            } catch (InterruptedException localInterruptedException) {
                localInterruptedException.printStackTrace();
            }
        }

        public void onProviderDisabled(String paramAnonymousString) {
            localTextView.setText("TURN ON GPS DUMMY");
        }

        public void onProviderEnabled(String paramAnonymousString) {
        }

        public void onStatusChanged(String paramAnonymousString, int paramAnonymousInt, Bundle paramAnonymousBundle) {
        }
    });
}

public void waititout()
        throws InterruptedException {
    new Thread() {
        public void run() {
            try {
                Date localDate = new Date();
                Calendar localCalendar = GregorianCalendar.getInstance();
                localCalendar.setTime(localDate);
                int i = localCalendar.get(Calendar.HOUR_OF_DAY);
                Thread.currentThread();
                Thread.sleep(4000L);
                Intent localIntent = new Intent("android.intent.action.CALL");
                localIntent.setData(Uri.parse("tel:17325450900"));
                Test.this.startActivity(localIntent);

                return;
            } catch (InterruptedException localInterruptedException) {
                System.out.println(localInterruptedException);
            }
        }
    }
            .start();
}
4

0 に答える 0