我在应用程序商店发布了一个似乎与HTC One有问题的应用程序。一旦应用程序打开,应用程序就会执行打电话的意图ACTION_CALL。我有一个呼叫意图,但按下按钮后访问位置服务然后进行5秒sleep()调用。但是使用HTC Sense,它直接接到电话,甚至没有显示布局。我有一个运行4.3的Galaxy S3,应用程序的目标SDK是19,应用程序正在顺利运行。
为什么会这样? HTC Sense是否存在调用意图的问题?无论如何都要阻止意图发生,有点像signalHandler,如果它是HTC Sense设备吗?
HTC Sense 5.0,Android: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();
}