android-intent

Unable to solve errors in android?

*爱你&永不变心* 提交于 2020-01-10 05:35:23
问题 I am working on android quiz game. QuestionActivity and EndgameActivity are 2 classes in my game. I want when my game over control transferred to EndgameActivity. For this in QuestionActivty class i add Intent i = new Intent(this, EndgameActivity.class); startActivity(i); finish(); in if(currentGame.isGameOver()) method. But after answering last question when my game over control not tranferring to EndgameActivity and log cat showing following errors. QuestionActivity Class- public class

How to force a video to play in fullscreen in youtube player?

耗尽温柔 提交于 2020-01-10 04:53:25
问题 I have an app where the help section has a tutorial video I want to force this video to open in Fullscreen using the Youtube player (Just like the Market/Play app does). it forces videos to play in Fullscreen even if it's a portrait video. I use this code to force the video to open in youtube player String videoId = "VIDEO_ID_HERE"; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("vnd.youtube:"+videoId)); intent.putExtra("VIDEO_ID", videoId); startActivity(intent); 回答1: Youtube v4.1

Android Launching Contacts Application

懵懂的女人 提交于 2020-01-10 04:44:05
问题 I wanna launch the Contacts application from my application Activity. I am not able to understand how to do it. Button contact = (Button) findViewById(R.id.contact); contact.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { Intent i4 = new Intent(); i4.setAction(Intent.ACTION_VIEW); i4.addCategory(Intent.CATEGORY_DEFAULT); i4.setType("vnd.android.cursor.dir/phone"); startActivity(i4); } }); Error: 回答1: void showContacts() { Intent i = new Intent(); i

Location Client request location updates with parcelable extras in PendingIntent

别等时光非礼了梦想. 提交于 2020-01-10 04:14:29
问题 I am using LocationClient with PendingIntent to get location updates. PendingIntent.getService(context, 0, new Intent(context, OnLocationAvail.class), PendingIntent.FLAG_UPDATE_CURRENT) The Above code works fine I get the location from the key LocationClient.KEY_LOCATION_CHANGED But when I have an extras of parcelable data as described below, the service gets called with the parcelable data but the key LocationClient.KEY_LOCATION_CHANGED in the intent extras is always null. Intent

Location Client request location updates with parcelable extras in PendingIntent

狂风中的少年 提交于 2020-01-10 04:14:07
问题 I am using LocationClient with PendingIntent to get location updates. PendingIntent.getService(context, 0, new Intent(context, OnLocationAvail.class), PendingIntent.FLAG_UPDATE_CURRENT) The Above code works fine I get the location from the key LocationClient.KEY_LOCATION_CHANGED But when I have an extras of parcelable data as described below, the service gets called with the parcelable data but the key LocationClient.KEY_LOCATION_CHANGED in the intent extras is always null. Intent

Starting Video Camera with Intent

☆樱花仙子☆ 提交于 2020-01-10 02:17:15
问题 I am writing a very small app that just opens the camera app ready for video. I am able to get my code to work on an Android 2.2 emulator, but it will not work on my device, Motorola Droid 1 stock 2.2 FRG22D. Any ideas where I went wrong on this code? public class StartVid extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final int VIDEO = 1; Intent

Android: How to get a content:// URI for a file in the external storage PUBLIC directory

僤鯓⒐⒋嵵緔 提交于 2020-01-09 19:45:33
问题 I've followed this Google tutorial to start an intent to capture an image with new Intent(MediaStore.ACTION_IMAGE_CAPTURE) . The tutorial recommends using the public directory with getExternalStoragePublicDirectory which would work great for my app. But then their example instead uses getExternalFilesDir . Then to pass the URI of the file to the intent with MediaStore.EXTRA_OUTPUT I have to get a content URI because I'd like to target Android N. Before targeting N I would just pass a file://

Android: How to get a content:// URI for a file in the external storage PUBLIC directory

我的未来我决定 提交于 2020-01-09 19:45:10
问题 I've followed this Google tutorial to start an intent to capture an image with new Intent(MediaStore.ACTION_IMAGE_CAPTURE) . The tutorial recommends using the public directory with getExternalStoragePublicDirectory which would work great for my app. But then their example instead uses getExternalFilesDir . Then to pass the URI of the file to the intent with MediaStore.EXTRA_OUTPUT I have to get a content URI because I'd like to target Android N. Before targeting N I would just pass a file://

How to make video call programmatically on Android 2.2 or higher?

☆樱花仙子☆ 提交于 2020-01-09 19:32:07
问题 I am working on an application where I want to make a video call programmatically. I am using API level 8 for my application. I have Samsung Galaxy S, where I can use video calling functionality. Using intent action ACTION_CALL , I can start voice call. How to start video call? Which intent extra I have to provide? Is there any particular field which indicates that current outgoing call is video call? If yes, how can I set that field to indicate that I want to invoke a video call? 回答1: Here

Android Intent.FLAG_ACTIVITY_SINGLE_TOP AND Intent.FLAG_ACTIVITY_CLEAR_TOP

妖精的绣舞 提交于 2020-01-09 19:04:46
问题 I have an app that I have running a media player and I want to resume the activity from my apps home activity. I can successfully do this by adding the following flags to the startActivity Call: myIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); I am worried that this is not an ideal way to do things since it took me a long time to find it. It made me think that no one uses it very much. Are there any pitfalls to using this method? 回答1: Just to make sure I