Page 1 of 1

Android : Some Useful Intents

Posted: Tue 24 Oct 2017 2:05 pm
by tong
Implicit Intent

เป็นรูปแบบการใช้งาน Intent ที่ไม่ได้ระบุ Component หรือ Class อย่างเจาะจง จะเป็นตัวไหนก็ได้ ขอแค่ตรงกับเงื่อนไขที่กำหนดไว้ก็พอ ซึ่งเงื่อนไขที่ว่าก็คือ Action, Type และ Category

Code: Select all

Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, "Hello World");
intent.setType("text/plain");
startActivity(intent);

Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, "Hello World");
intent.setType("text/plain");
startActivity(intent);
Explicit Intent

เป็นรูปแบบการใช้งาน Intent ที่มีการระบุ Component หรือ Class ปลายทางอย่างเจาะจง

Code: Select all

String packageName = "com.google.android.apps.photos";
String className = "com.google.android.apps.photos.home.HomeActivity";

Intent intent = new Intent(packageName, className);
startActivity(intent);

Intent intent = new Intent();
intent.setClass(packageName, className);
startActivity(intent);

Intent intent = new Intent();
intent.setComponent(new ComponentName(packageName, className));
startActivity(intent);
http://www.akexorcist.com/2017/01/android-intent-and-pending-intent.html

Re: Android: Some Useful Intents

Posted: Tue 24 Oct 2017 2:06 pm
by tong
...

Re: Android: Some Useful Intents

Posted: Tue 24 Oct 2017 2:07 pm
by tong
Google Play - My apps & games (Updates)

Code: Select all

Action  : com.google.android.finsky.VIEW_MY_DOWNLOADS
Package : com.android.vending
Class   : com.google.android.finsky.activities.MainActivity
Target  : Activity
Google Play - Games

Code: Select all

Action: android.intent.action.VIEW
Data: https://play.google.com/store/apps/category/GAME
Target: Activity
Google Play - Apps

Code: Select all

Action: android.intent.action.VIEW
Data: https://play.google.com/store/apps
Target: Activity
Google Play - Movies

Code: Select all

Action: android.intent.action.VIEW
Data: https://play.google.com/store/movies
Target: Activity
Google Play - Books

Code: Select all

Action: android.intent.action.VIEW
Data: https://play.google.com/store/books
Target: Activity
Android monitor filter urls and launch Google Play automatic.

Re: Android: Some Useful Intents

Posted: Tue 24 Oct 2017 2:08 pm
by tong
Reset Ads ID

Code: Select all

Action  : com.google.android.gms.settings.ADS_PRIVACY
Target  : Activity

Re: Android: Some Useful Intents

Posted: Tue 24 Oct 2017 2:10 pm
by tong
App Info FIFA Mobile

Code: Select all

Action  : android.settings.APPLICATION_DETAILS_SETTINGS
Data    : package:com.ea.gp.fifamobile
Target  : Activity
App Info Gboard

Code: Select all

Action  : android.settings.APPLICATION_DETAILS_SETTINGS
Data    : package:com.google.android.inputmethod.latin
Target  : Activity

Re: Android: Some Useful Intents

Posted: Mon 11 Dec 2017 1:11 pm
by tong
Start FRep Service

Code: Select all

Action  : android.intent.action.MAIN
Extra   : wakeuponly:true
Package : com.x0.strai.frep
Class   : com.x0.strai.frep.FingerActivity
Target  : Activity

Re: Android: Some Useful Intents

Posted: Tue 26 Jun 2018 10:01 pm
by tong
Developer Options

Code: Select all

Action  : android.settings.APPLICATION_DEVELOPMENT_SETTINGS
Target  : Activity

https://developer.android.com/reference/android/provider/Settings
https://androidforums.com/threads/setting-intents.1126042/

Code: Select all

android.provider.Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS

change to

android.settings.APPLICATION_DEVELOPMENT_SETTINGS

Re: Android: Some Useful Intents

Posted: Sat 13 Oct 2018 12:48 am
by tong
Open web in Chrome

Code: Select all

Action  : android.intent.action.VIEW
Data    : https://www.google.com
Package : com.android.chrome
Class   : com.android.chrome.activities.BrowserInterceptActivity
Target  : Activity
com.google.android.apps.chrome.Main

Re: Android: Some Useful Intents

Posted: Sat 12 Oct 2019 4:22 pm
by tong
Tethering Settings

Code: Select all

Package : com.android.settings
Class   : com.android.settings.TetherSettings
Target  : Activity

Re: Android: Some Useful Intents

Posted: Sat 12 Oct 2019 4:59 pm
by tong
Media Scan

Code: Select all

Action  : android.intent.action.MEDIA_SCANNER_SCAN_FILE
Data    : file:///sdcard/ or content://sdcard/
Target  : Broadcast

Re: Android : Some Useful Intents

Posted: Sun 16 May 2021 11:55 am
by tong

Code: Select all

pm clear com.ea.gp.fifamobile
/system/bin/reboot bootloader
/system/bin/reboot recovery
svc power reboot
svc power shutdown
/system/bin/input keyevent 26

Re: Android : Some Useful Intents

Posted: Fri 06 Oct 2023 1:32 am
by tong
Bluetooth Settings

android.settings.BLUETOOTH_SETTINGS
android.bluetooth.devicepicker.action.LAUNCH

Re: Android : Some Useful Intents

Posted: Wed 29 Nov 2023 4:41 pm
by tong
Create DropSync "Sync Now" shortcut on MIUI

Code: Select all

Action  : android.intent.action.MAIN
Package : com.ttxapps.dropsync
Class   : com.ttxapps.sync.app.SyncNowShortcutActibity
Target  : Activity