-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import android.content.ComponentName; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.content.pm.PackageItemInfo; | ||
import android.content.pm.ResolveInfo; | ||
import android.content.pm.ActivityInfo | ||
import android.os.Bundle; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
|
||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.example.com")); | ||
PackageManager pm = getPackageManager(); | ||
// ruleid: android-resolve-intent | ||
ResolveInfo resolveInfo = pm.resolveService(intent, 0); | ||
// ruleid: android-resolve-intent | ||
resolveInfo = pm.resolveContentProvider(intent, 0); | ||
// ruleid: android-resolve-intent | ||
resolveInfo = pm.resolveActivity(intent, 0); | ||
// ruleid: android-resolve-intent | ||
ComponentName componentName = intent.resolveActivity(pm); | ||
// ruleid: android-resolve-intent | ||
ActivityInfo activityInfo = intent.resolveActivityInfo(pm); | ||
// ruleid: android-resolve-intent | ||
List<ResolveInfo> resolveInfoList = pm.queryBroadcastReceivers(intent,0); | ||
// ruleid: android-resolve-intent | ||
resolveInfoList = pm.queryIntentActivities(intent,0); | ||
// ruleid: android-resolve-intent | ||
resolveInfoList = pm.queryIntentActivityOptions(null,null,intent,0); | ||
// ruleid: android-resolve-intent | ||
resolveInfoList = pm.queryIntentServices(intent,0); | ||
// ruleid: android-resolve-intent | ||
List<ProviderInfo> providerInfoList = pm.queryIntentContentProviders(intent,0); | ||
} | ||
} |