android-intent

How do I make an intent-filter for streaming an MP3 file?

一曲冷凌霜 提交于 2020-01-01 05:44:05
问题 On Android, if you type a URL to an MP3 file in the browser (or click on a link to the file) you get that "Complete action using" popup with some applications listed that can play the file (Music, StreamFurious, Streaming Media Player, Winamp, XiiaLive Lite, to name a few). How can I get my application to show up in that list? I'm pretty sure there's an intent-filter I have to add to the AndroidManifest.xml but I have no idea what action, category, or data needs to be in it. Anyone know what

DialogFragment crashes Activity when calling startActivity()

£可爱£侵袭症+ 提交于 2020-01-01 05:42:28
问题 I have a DialogFragment that was supposed to be simple but it's giving me some big problems specifically on Jelly Bean. The app uses the network and it pops a dialogue asking the user to turn on WiFi or cancel then closes it. So it extends DialogFragment and creates view as: @Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog a = new AlertDialog.Builder(getActivity()).setCancelable(true).setTitle(R.string.dialog_title_disabled) .setMessage(R.string.dialog_text)

Broadcast intents for bluetooth, wifi and ringer mode

笑着哭i 提交于 2020-01-01 05:37:05
问题 What are the intents that are broadcasted in the following events, Wifi state change Bluetooth state change Ringer mode change 回答1: For Wifi state changes: WifiManager.WIFI_STATE_CHANGED_ACTION ("android.net.wifi.WIFI_STATE_CHANGED") Broadcast intent action indicating that Wi-Fi has been enabled, disabled, enabling, disabling, or unknown. One extra provides this state as an int. Another extra provides the previous state, if available. WifiManager.NETWORK_STATE_CHANGED_ACTION ("android.net

How do you serialize Android Intents?

只谈情不闲聊 提交于 2020-01-01 05:26:07
问题 Android Intents have a convenient toURI() method which the API docs seem to indicate is a way to serialize an Intent to a URI, and then later parse it back into an Intent. Unfortunately, in testing this functionality I found that it does not serialize all extras, just the primitive types (boolean, int, long, float, String). If an intent specifies any Parcelable or array extras then those will get lost. Where (if anywhere) is this limitation documented? Is there some obvious reason for this

Android Rendering Problems Couldn't resolve resource @string/app_name

左心房为你撑大大i 提交于 2020-01-01 05:05:09
问题 I'm new to android programming and I don't understand what I'm doing wrong. I try to make a button like this in the xml file: <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/btnText" android:id="@+id/button" android:layout_centerVertical="true" android:layout_centerHorizontal="true" /> This works fine, without the android:text="@string/btnText" part... My strings.xml file looks like this: <string name="btnText">GO!</string> I get this

New KitKat URIs dont respond to Intent.ACTION_VIEW

大憨熊 提交于 2020-01-01 04:31:34
问题 Since KitKat has changed the URIs from pickers to likes of content://com.android.providers.media.documents/document/image:3951 then none of my ACTION_VIEW intents work anymore. When for example user picks an image, I use public static void openImage(Fragment f, Uri uri) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(uri, "image/*"); f.startActivity(intent); } and Android Gallery and Google+ Photos come up, but when selected, the Gallery just shows blank screens,

How can I have my app appear in the intent chooser only for certain urls?

假如想象 提交于 2020-01-01 04:31:08
问题 I am developing an app that can extract information from certain web pages. The idea is that when the user is within a specific url path in the browser and press the share button, my app will show up in the list of receiver apps. I can do that easily by adding this to the manifest: <intent-filter android:label="@string/app_name" > <action android:name="android.intent.action.SEND" /> <data android:mimeType="text/plain" /> <category android:name="android.intent.category.DEFAULT" /> </intent

Onclick event on textview(that has TextIsSelectable=“true”) is ony called on second click

℡╲_俬逩灬. 提交于 2020-01-01 04:19:35
问题 I have a onClickListener on a textview and the textview has the flag that it's selectable . But the onclick event I specified is only called when the textview is clicked a second time. After the second time it calles the onclick right, but if a other textview that also is selectable with a onclicklistener it also is only called the second time, then it works fine, but then the other one works only the second time again. I can't find the source of this weird events. telefoonTXT

in Android if OS kills my application, will getIntent() return the Intent with the same extras?

落花浮王杯 提交于 2020-01-01 04:09:07
问题 After my application has been restored, of course. or I have to store everything at onSaveInstanceState()? 回答1: This conversation seems to answer it: http://groups.google.com/group/android-developers/browse_thread/thread/f47af26b696af2e2. Look for the post starting with "Yes and no" and the few before it. The answer is in the positive: yes, after restart of an Activity shut down by the OS, getIntent() will return an Intent with the same extras as the original . Nevertheless, if some Android

Espresso startActivity that depends on Intent

限于喜欢 提交于 2020-01-01 03:58:28
问题 I have the following situation. My activity has a fragment that depends of a Serializable Object. Here is my onCreate: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); MyObject myObj = (MyObj) getIntent().getSerializableExtra("myobj"); if(myObj != null) { FragmentManager manager = getSupportFragmentManager(); FragmentTransaction transaction = manager.beginTransaction(); transaction.add(R.id.container, MyFragment.newInstance(myObj));