android-intent

Android open gallery from folder

▼魔方 西西 提交于 2021-02-09 02:47:51
问题 I want to show a photo in android gallery, and be able to slide throw the others photos on that folder. Intent intent = new Intent(Intent.ACTION_VIEW); File f = new File(path); intent.setDataAndType(Uri.parse("file://" + f.getAbsolutePath()), "image/*"); mContext.startActivity(intent); thats how i am doing it now, but wont let me slide throw the rest of the images in the folder. i tried: How to open one particular folder from gallery in android? Built-in gallery in specific folder Gallery

Has anyone received Android MY_PACKAGE_REPLACED notifications?

牧云@^-^@ 提交于 2021-02-08 19:42:43
问题 I never get the MY_PACKAGE_REPLACED notifications. If I change it to PACKAGE_REPLACED, I do get the expected notifications. My SDK level is 19 and the devices are 4.0 and above. Does anyone have insight into this problem? My receiver definition: <receiver android:name="com.jerome.applications.service.PackageReplacedReceiver"> <intent-filter> <action android:name="android.intent.action.MY_PACKAGE_REPLACED" /> <data android:scheme="package" /> </intent-filter> </receiver> My receiver: public

Has anyone received Android MY_PACKAGE_REPLACED notifications?

梦想的初衷 提交于 2021-02-08 19:42:39
问题 I never get the MY_PACKAGE_REPLACED notifications. If I change it to PACKAGE_REPLACED, I do get the expected notifications. My SDK level is 19 and the devices are 4.0 and above. Does anyone have insight into this problem? My receiver definition: <receiver android:name="com.jerome.applications.service.PackageReplacedReceiver"> <intent-filter> <action android:name="android.intent.action.MY_PACKAGE_REPLACED" /> <data android:scheme="package" /> </intent-filter> </receiver> My receiver: public

Has anyone received Android MY_PACKAGE_REPLACED notifications?

半世苍凉 提交于 2021-02-08 19:42:22
问题 I never get the MY_PACKAGE_REPLACED notifications. If I change it to PACKAGE_REPLACED, I do get the expected notifications. My SDK level is 19 and the devices are 4.0 and above. Does anyone have insight into this problem? My receiver definition: <receiver android:name="com.jerome.applications.service.PackageReplacedReceiver"> <intent-filter> <action android:name="android.intent.action.MY_PACKAGE_REPLACED" /> <data android:scheme="package" /> </intent-filter> </receiver> My receiver: public

Pass interface between activities in intent - interface fails to be Serializable or Parcelable

冷暖自知 提交于 2021-02-08 12:20:14
问题 I want to pass an interface from 1st activity to 2nd activity. I want to initiate methods from the interface from the 2nd activity which will affect the 1st activity. I'm well aware that it's very overkilling not using the onActivityResult mechanism, and that it might not be good programming, but roll with me please. Here's the issue - my interface can't implement Serializable / Parcelable since interface can't implement another class. This is my interface : public interface ITest { void

how to get data usage from settings in android

﹥>﹥吖頭↗ 提交于 2021-02-08 11:31:26
问题 I'm trying to get 3g and wifi usage from Settings page in android, is there anyway to do that, i can set an intent Settings data usage page, code is below; Intent intent = new Intent(); intent.setComponent(new ComponentName("com.android.settings","com.android.settings.Settings$DataUsageSummaryActivity")); startActivity(intent); But is there any way to reach these intent's component and to get data from those components. Thankss.. 回答1: Yes you can programmatically get the data usage // Get

Parcelable object passing from android activity to fragment

帅比萌擦擦* 提交于 2021-02-08 11:24:45
问题 I'm trying to pass an object that implements Parcelable from an activity to a fragment. I know how to pass from activity to activity. I just want to try this. But when I received the object it always received null . How can I resolve this problem? currentObject is the object instance of the class which implements Parcelable ContentMainFragment is the Fragment class In the activity Fragment fragment = new ContentMainFragment(); Bundle bundle = new Bundle(); bundle.putParcelable("SampleObject",

Parcelable object passing from android activity to fragment

。_饼干妹妹 提交于 2021-02-08 11:24:21
问题 I'm trying to pass an object that implements Parcelable from an activity to a fragment. I know how to pass from activity to activity. I just want to try this. But when I received the object it always received null . How can I resolve this problem? currentObject is the object instance of the class which implements Parcelable ContentMainFragment is the Fragment class In the activity Fragment fragment = new ContentMainFragment(); Bundle bundle = new Bundle(); bundle.putParcelable("SampleObject",

How to perfectly sync clock app widget with system clock in Android?

一世执手 提交于 2021-02-08 10:40:14
问题 I made a digital clock widget which is using AlarmManager to update the time every 60 seconds. @Override public void onEnabled(Context context) { super.onEnabled(context); Log.d("onEnabled","Widget Provider enabled. Starting timer to update widget every minute"); AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); alarmManager.setRepeating(AlarmManager.RTC, System.currentTimeMillis(), 60000, createClockTickIntent(context)); } The problem is, polling the

Pass array in Intent using parcelable

a 夏天 提交于 2021-02-08 10:16:34
问题 I would like to send an array of objects between activities. I want to use the parcelable interface and send the data in an intent. However I keep getting errors. I have been stuck for 2 days. Here are some details about my problem. Class A private ProjetUI[] mProjects; private final View.OnClickListener mOnClickListener = new View.OnClickListener() { @Override public void onClick(View view) { Context context = view.getContext(); Intent intent = new Intent(context, ProjetListActivity.class);