mirror of
https://gitlab.com/xynngh/YetAnotherCallBlocker.git
synced 2025-02-27 00:57:49 +01:00
Don't use Intent.resolveActivity()
This commit is contained in:
parent
995f5277cc
commit
d5e0793494
@ -1,6 +1,7 @@
|
|||||||
package dummydomain.yetanothercallblocker;
|
package dummydomain.yetanothercallblocker;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -322,9 +323,10 @@ public class BlacklistActivity extends AppCompatActivity {
|
|||||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||||
intent.setType("*/*");
|
intent.setType("*/*");
|
||||||
|
|
||||||
if (intent.resolveActivity(getPackageManager()) != null) {
|
try {
|
||||||
startActivityForResult(intent, REQUEST_CODE_IMPORT);
|
startActivityForResult(intent, REQUEST_CODE_IMPORT);
|
||||||
} else {
|
} catch (ActivityNotFoundException e) {
|
||||||
|
LOG.warn("onImportBlacklistClicked()", e);
|
||||||
Toast.makeText(this, R.string.error, Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, R.string.error, Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user