intent

android startActivity from intent in service [duplicate]

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This question already has an answer here: android start activity from service 6 answers i try to use intent in service but when i try this : Intent intent_facebook = new Intent (this,MainUploadToYoutube.class); intent_facebook.putExtra("vid", vid); startActivity(intent_facebook); got this error on logcat : Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? so i tried this from here : android start activity from service Intent intent_facebook = new Intent

How to add app's shortcut to the home screen

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I know it's not documented and won't work on every device, but I see more and more apps placing their shortcuts on the home screen after they got installed. Found bunch of code chunks how to do it but for me they don't fit together. This is what I got for now. Need a permission in the manifest. Create an Intent of activity that should be called. Ex (from cgeek): Intent shortcutIntent = new Intent (); shortcutIntent . setClassName ( "com.example.androidapp" , "SampleIntent" ); shortcutIntent . addFlags ( Intent . FLAG_ACTIVITY_NEW

How to start and App Chooser

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The task of this application is to implicitly activate a separate application to view the URL, “http:// www.google.com”. So, App Chooser should appear and let me choose between at least two browsers: the default one, which will show me the www.google.com site, and another simple "browser", which just shows me the url. The problem is - App chooser doesn't appear, when i use implicit activity. Probably I wrote wrong intent filters for second "simple browser". private void startImplicitActivation() { Log.i(TAG, "Entered startImplicitActivation(

Android - Firebase - Different types of Users Login

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Aim Allow different types of Users to sign into their respective interfaces Description Types of Users (3): Student Parent Teacher Each user is registered via Firebase Authentication Email Each user should be able to access their respective interfaces as each interface if different from the other Each user has already been saved with their respective child nodes within the Firebase Database. For example, under the "Users" there's a "School" and under that are the user types such as "Student", "Parent", and "Teacher". Database for

How to fix The method startActivity(Intent) is undefined for the type new View.OnClickListener() syntax error

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a syntax errors with my code , in the "getView" I want to make a listener for the button "update" to move to another activity : @Override public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater l = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE); View rowView = l.inflate(R.layout.temp, parent, false); TextView textView = (TextView) rowView.findViewById(R.id.textView1); ImageView imageView = (ImageView) rowView.findViewById(R.id.imageView1); Button update = (Button) rowView

Get the intent from onCreate in Android

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I launch an activity from my widget using an Intent with some extra, anyway I can only get the Intent when the activity is in background.. How can I get the Intent when activity is created? Tried with this.getIntent() but extras are null. Thanks in advance 回答1: How can I get the Intent when activity is created? Call getIntent() on the Activity . Tried with this.getIntent() but extras are null. One possibility is that you are arranging for an existing instance of the activity to return to the foreground (e.g., including FLAG_ACTIVITY_REORDER

FCM : onMessageReceived is not called,notification didn't came even after sending msg to fcm?

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i am developing an app where i want to implement FCM push notifications through php. So i made two java files: 1.FirebaseInstanceID (Working fine and getting token properly in database) 2.FirebaseMessagingSerivice (Not Called) My FirebaseMessagingService.java package com.example.xyz; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Intent; import android.support.v4.app.NotificationCompat; import com.google.firebase.messaging.RemoteMessage; public class FirebaseMessagingService extends com

Difference between putExtra() and setData()

匿名 (未验证) 提交于 2019-12-03 08:36:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What is the difference between putExtra() and setData()? I have read the android docs but it is of not much help. Also there is a previous question Intent.setData vs Intent.putExtra but it is still not clear. Thanks in advance. 回答1: setData() Set the data this intent is operating on. This method automatically clears any type that was previously set by setType(String) or setTypeAndNormalize(String). Note : scheme matching in the Android framework is case-sensitive, unlike the formal RFC. As a result, you should always write your Uri with a

Keeping alive Intent Service after application is killed

匿名 (未验证) 提交于 2019-12-03 08:36:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have intent service in my app. This service has some job to do - uploading some files. It runs only when there is something to do. Service won't upload when some conditions are met, for example no Internet connection. For that reason it registers itself to on broadcast receiver to receive message about Internet connection changes. The problem is that service is killed with app even if it is doing something, for example: App is sending intent to service Service started uploading something, everything fine X% uploaded, app is

Cannot resolve method startActivity()

匿名 (未验证) 提交于 2019-12-03 08:36:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm new to the android development and having a bit of a problem changing activities. I am trying to change activities from within a method but I am getting the error cannot resolve method startActivity and on the parameter end the error Cannot resolve constructor 'Intent (...)' . I found a question here with the same sort of problem and tried to implement their replies into my program but no joy. Here's the code: public void open301(View view) { startActivity(new Intent(CustomAdapter.this, ThreeZeroOne.class)); } before looking at the