android-intent

Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference

回眸只為那壹抹淺笑 提交于 2019-12-23 09:55:59
问题 Unable to pass data from one fragment to another using intent. Logic is fine .Please check the last parts of main activity where I have sent strings to other activity using putExtra. Here is the MainActivity.java : public class MainActivity extends Activity implements View.OnClickListener { EditText ed1,ed2,ed3,ed4,ed5,ed6; Button bt1; TextView tv1,tv2; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);

parent activity with implicit intents

别说谁变了你拦得住时间么 提交于 2019-12-23 09:48:12
问题 I am successfully using the attribute android:parentActivityName in manifest, in order to set the parent activity (activity A) when another activity (activity B) is started by a push notification, for example. Then, if I go back, I navigate to activity A. However, it doesn't work with implicit intents. I have an intent-filter declared in manifest for activity B. When activity B is launched from outside the app, it does not seem to effect the attribute android:parentActivityName (or meta-data

Picture file captured with camera intent empty for a while in onActivityResult

删除回忆录丶 提交于 2019-12-23 09:28:05
问题 I am having a very strange bug trying to take a picture via intent. Activity code (a little simplified): private void startCapture() throws IOException { // Create output file final File photoFile = makePhotoFile(); _photoPath = photoFile.getAbsolutePath(); Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); /* IMPORTANT NOTE TO READERS * As of Android N (which went out shortly after I posted this question), * you cannot use Uri.fromFile this way anymore. * You should use a

How to verify IntentService start

隐身守侯 提交于 2019-12-23 09:26:38
问题 I'm trying to test my app behavior with Espresso-2.2 On main activity, when button pressed both service and another activity is being started: public class MainActivity extends Activity { public void onButtonClicked() { startActivity(SecondActivity.getStartIntent()); startService(MyIntentService.getStartIntent()); } } I'm testing if intended components are being started: public class MainActivityTest { @Rule public final IntentsTestRule<MainActivity> intentsRule = new IntentsTestRule<>

App force closes when google+ is not installed

拥有回忆 提交于 2019-12-23 09:16:41
问题 My requirement is to share on Social networking sites. So, I have already done with Facebook and Twitter. But I am stuck with Google+ . I have the following code to share on Google+ , but the app forcecloses when I start activity. This occurs only when the Google+ app isn't installed on device already. I know this sharing intent requires the Google+ already installed to start the activity. Now what I need to do is at least to inform the user that the google+ sharing requires already installed

Solve SecurityException: Permission Denial: starting Intent. What permission do I need?

允我心安 提交于 2019-12-23 09:04:20
问题 I want to open the play store from app. It's fine in Samsung, but it failed in OnePlus mobile. I don't know where does the alibaba come from. It's strange. Exception java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.VIEW dat=http://play.google.com/... cmp=com.alibaba.intl.android.apps.poseidon/com.alibaba.android.intl.weex.activity.WeexPageActivity } from ProcessRecord{a1dd30c 15827:a2bliving.ie.a2b/u0a151} (pid=15827, uid=10151) not exported from uid

Is it safe to use Intent.FLAG_ACTIVITY_MULTIPLE_TASK?

我怕爱的太早我们不能终老 提交于 2019-12-23 09:03:09
问题 Background Let's take the next sceneraio: the user uses an app X which has multiple activities (like the gmail app). after navigating the app X a bit, he goes to your app. in your app, you need to start this X app using an intent, to go to a specific activity within it. now the user goes to this specific activity on the app X. the user presses the back button, hoping to go back to your app instead of staying on the app X. another similar scenario: the user navigates on your app between

Intent flags - How to start a new activity instance and have others closed

有些话、适合烂在心里 提交于 2019-12-23 08:57:36
问题 I am not really familiar with intent flags, so please, bear with me. I am doing an application which displays stuff from a database in a ViewPager. I also have a widget which from time to time pulls out a random row and displays it. Now, when I click on it, I am taken to an activity where the same content is displayed and now I can take action on it. Everything works, however when I have an activity already running and then click on the widget, it seems it creates a new instance, because when

fb://profile/{userid} seems to be not working

天大地大妈咪最大 提交于 2019-12-23 08:48:29
问题 I try to launch facebook app with specific page , it was working with earlier version of FB APP but with new version that is 25.0.0.19.30 . This functionality is not working , the intent with uri.parse("fb://profile/{userid}") takes me to content not available page . Is it an security update from facebook. any other way to launch the app with particular user page. 回答1: You should use fb://page/{id} Learned it from here: http://binwaheed.blogspot.com.ar/2014/06/android-open-facebook-official

Start activity from service takes too long

让人想犯罪 __ 提交于 2019-12-23 08:47:05
问题 I have a Service that when one function gives to me true it will start a new Activity but it takes like 5 seconds... I've read about this issue, and I've found on StackOverflow this example to "avoid" this bug.. Intent intent = new Intent(this, MainActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0); try { pendingIntent.send(); } catch (PendingIntent.CanceledException e) { e.printStackTrace(); } but sadly