android-intent

Start default music player with music playing by default

时光总嘲笑我的痴心妄想 提交于 2019-12-23 03:39:14
问题 I am developing an application where I need to start the default music app and play all the songs. I have tried a number of approaches, but nothing seems to work. Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage( "com.android.music.MediaPlaybackActivityStarter"); startActivity( LaunchIntent ); and Intent intent = new Intent(); ComponentName comp = new ComponentName("com.android.music", "com.android.music.MediaPlaybackActivity"); intent.setComponent(comp); intent.setAction

How could I Send Data(Text) to other apps(like messages)

ぃ、小莉子 提交于 2019-12-23 03:28:10
问题 How could I make a program that after entering a string and press a key, the string is stored in the phone (SharedPreferences), and then if I open the program to Send Sms(messages), 3 seconds later write in the Message EditText the string stored before. so far I've done this: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); EditText stringinput = (EditText) findViewById(R.id.string); Button bu = (Button)

Can not getIntExtra() at onActivityResult

女生的网名这么多〃 提交于 2019-12-23 03:23:09
问题 I got a problem with sending and receiving int types from one activity to another via Intent; I'm sending it with onActivityResult() function which is placed at the receiving activity. The code: The Sending Activity: Intent ba=new Intent(); MyPoints = fgv.getPoints(); int MP=(int)MyPoints; Log.i("Problem","MyPoints MP = "+MP); ba.putExtra("FocusScore",MP); Log.i("Problem","MyPoints = "+MP); setResult(RESULT_OK,ba); finish(); The Receiving Activity: //At the onClick in order to move the the

Missing URL error on VIEW Intent filter if I specify mimeType for action PICK

六月ゝ 毕业季﹏ 提交于 2019-12-23 03:21:42
问题 I have an app that could view different kinds of video files using intent filters from different sources. To allow the app to appears always as choice when I try to open whatever video file, I have placed this code in the manifest <intent-filter> <action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.PICK"/> <data android:mimeType="video/*" /> </intent-filter> So I can receive the Uri in the app handling It in the main activity. Although everything

Need help opening a url in the phone's default browser

こ雲淡風輕ζ 提交于 2019-12-23 03:16:25
问题 I'm trying to make test-program that opens a website by pushing a button. I have made a listener and everything, my problem is just that, the url-opening-script makes an error and tells me "Uri cannot be resolved". Here's the script I use to open up an webpage: Intent browserIntent = new Intent("android.intent.action.VIEW",Uri.parse("http://www.google.com")); startActivity(browserIntent); I have the import android.app.Activity; , import android.content.Intent; and import android.content

startActivityForResult not working in Android version 4.4 ( Kitkat version )

最后都变了- 提交于 2019-12-23 03:12:56
问题 Through my application the user can choose a file from the filemanager and process the choosen file ( Example: A PDF document ) for other steps like printing or to email. To do this I used the below code to display the intent, from which the user can choose a file from file-manager option. protected void showFileChooser(String title, String type) { Log.i(TAG, "FileChooserActivity showFileChooser(title,type)"); if (TextUtils.isEmpty(title)) title = getString(R.string.select_file); if

onClickListener in RecyclerView adapter?

主宰稳场 提交于 2019-12-23 03:01:30
问题 I want to set up an onClickListener within my RecyclerView adapter so I can easily refer to the other views to retrieve their tags. Is it possible to set up an onClickListener in a RecyclerView adapter? How would I do it? Would it affect performance? Here is my RecyclerView adapter: public class PostRecyclerAdapter extends RecyclerView.Adapter<PostRecyclerAdapter.ViewHolder> { private Context context; private List<Post> mDataset; public static class ViewHolder extends RecyclerView.ViewHolder

onClickListener in RecyclerView adapter?

☆樱花仙子☆ 提交于 2019-12-23 03:01:14
问题 I want to set up an onClickListener within my RecyclerView adapter so I can easily refer to the other views to retrieve their tags. Is it possible to set up an onClickListener in a RecyclerView adapter? How would I do it? Would it affect performance? Here is my RecyclerView adapter: public class PostRecyclerAdapter extends RecyclerView.Adapter<PostRecyclerAdapter.ViewHolder> { private Context context; private List<Post> mDataset; public static class ViewHolder extends RecyclerView.ViewHolder

Android :Tap on Push Notification does not open Application

 ̄綄美尐妖づ 提交于 2019-12-23 02:59:13
问题 I have an android app which requires some notifications from my web-server to my android phone . Earlier I used to receive notifications and on tapping the notification , my application used to open . However without anything being changed now , I receive all notifications but I cannot tap on them to open my application anymore . I have tried checking the code and the manifest for permissions , but dosen't seem to know the problem . Here are some of the required code files : AndroidManifest