android-intent

How to detect USB device in Android

半腔热情 提交于 2019-12-31 23:13:13
问题 I have USB host android device for that I need to connect USB device. to detect usb device to host I written following code. public class ReadData extends Activity { UsbManager usbManager; PendingIntent mPermissionIntent; UsbDevice usbDevice; Intent intent; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_read_data); usbManager = (UsbManager) getSystemService(Context.USB_SERVICE); final String ACTION_USB

What is Intent from onActivityResult Parameters

不想你离开。 提交于 2019-12-31 22:42:23
问题 Here is my first activity code from where I call the second Activity : @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT){ startActivityForResult(new Intent("chap.two.Chapter2Activity2"),request_Code); } return false; } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == request_Code) { if (resultCode == RESULT_OK) Toast.makeText(this,data.getData().toString(),Toast.LENGTH_SHORT)

TaskStackBuilder#startActivities() NullPointerException

让人想犯罪 __ 提交于 2019-12-31 22:22:07
问题 I have a crash that keeps occurring on 4.4.2 and 4.4.3 devices (although I'm not sure this is an API issue), where in some ParsePushBroadcastReceiver the following code causes a NullPointerException somewhere deep inside the startActivities call. Intent intent = new Intent(context, SomeActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); TaskStackBuilder.create(context) .addParentStack(SomeActivity.class) .addNextIntent(intent) .startActivities(); I have tried testing to see

Properly tracking install referrals on Play Store

此生再无相见时 提交于 2019-12-31 12:53:33
问题 I have a simple task: I want to track the referral id of an app install and pass it to backend. What I did: I created a link with an extra parameter referrer and appended it to the invite link. When it is opened, the javascript detects if the browser is an Android mobile browser and then prepares an intent and issues a redirect to that intent. While preparing the intent, referrer field is extracted from the url and appended to the intent like this: intent://scan/#Intent;scheme=com.example

Properly tracking install referrals on Play Store

无人久伴 提交于 2019-12-31 12:52:44
问题 I have a simple task: I want to track the referral id of an app install and pass it to backend. What I did: I created a link with an extra parameter referrer and appended it to the invite link. When it is opened, the javascript detects if the browser is an Android mobile browser and then prepares an intent and issues a redirect to that intent. While preparing the intent, referrer field is extracted from the url and appended to the intent like this: intent://scan/#Intent;scheme=com.example

Properly tracking install referrals on Play Store

主宰稳场 提交于 2019-12-31 12:52:10
问题 I have a simple task: I want to track the referral id of an app install and pass it to backend. What I did: I created a link with an extra parameter referrer and appended it to the invite link. When it is opened, the javascript detects if the browser is an Android mobile browser and then prepares an intent and issues a redirect to that intent. While preparing the intent, referrer field is extracted from the url and appended to the intent like this: intent://scan/#Intent;scheme=com.example

Android, What does this in Intent(this, …) mean [closed]

半城伤御伤魂 提交于 2019-12-31 07:43:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I am creating an Intent in android SDK but i don't know when to use the "this" value as argument or something else.. Can someone explain what "this" is used for? I know it means something like the object it's currently in but i don't know what the value is used for. tnx. 回答1: this is used to refer current

unable to pick files like pdf,doc,ppt in MARSHAMALLOW file chooser

倖福魔咒の 提交于 2019-12-31 07:16:08
问题 I am uploading files like pdf,ppt,doc etc to server using from my android app but in marshmallow when file chooser opens and i browse my Sdcard or internal storage there are two problmes : 1. it shows all files like images,videos and documents etc which i cannot pick but i used intent type as application/pdf; appkication/ppt etc.,so it should let me pick those files. 2. secondly when i use external file manager like ES file explorer etc it then show all files like images,videos,documents,apks

Opening specific part of system settings from app

南楼画角 提交于 2019-12-31 06:32:28
问题 I have a shortcut from my app which opens the storage part of system settings, (which works perfectly), but if the settings app is already running, and was last left from say the display settings, you don't get directed to the storage settings, but the display settings, when pressing the shortcut. Is there a way to force opening storage settings, or say close (if not closed) the settings app, before trying to launch the storage? I am using the intent android.settings.INTERNAL_STORAGE_SETTINGS

Opening specific part of system settings from app

為{幸葍}努か 提交于 2019-12-31 06:29:26
问题 I have a shortcut from my app which opens the storage part of system settings, (which works perfectly), but if the settings app is already running, and was last left from say the display settings, you don't get directed to the storage settings, but the display settings, when pressing the shortcut. Is there a way to force opening storage settings, or say close (if not closed) the settings app, before trying to launch the storage? I am using the intent android.settings.INTERNAL_STORAGE_SETTINGS