FAQ Database Discussion Community


Dealing with Fragment and listView and JSON

android,android-layout,android-intent,android-fragments,android-activity
I am trying to make an application with MenuDrawer that contains 4 fragments. This is how my application show do. When it starts, it should retrieve data from a website. The retrieved data should be in a listview in the first fragment. The second fragment should contain a webview to...

Android - unable to retrieve Intent when Activity is set to Single Top

android,android-intent,android-activity,android-task
I'm developing an app with the following scenario: Activity A -> Activity B -> Activity C -> Activity A I pass my values between each Activity through the Intents, and it works, but when I come back to Activity A, it seems all values are cleaned. Code from Activity C...

Android, create “non visible” .apk

android,android-intent,plugins
I am working on an Android framework which is composed by a main .apk that executes in foreground and a set of "plug-ins" which are .apk that can be downloaded and installed into the device silently. The main purpose of this architecture is to have only 1 application running and...

Cannot resolve constructor Intent

android,android-intent,android-tabhost
Im trying to add a tabhost to my application but i cant figure why this error 'cannot resolve constructor intent' is showing, here's my activity code: public class SixthFragment extends Fragment { public static final String TAG = "sixth"; @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)...

I have error when use context in adapter, i would like use startActivityForResult(…) in adapter, how should I do?

android,android-intent,android-activity,android-adapter,android-context
and thank you in advance for your suggestions. MainActivity.java RecyclerView.Adapter mAdapter; @Override ... protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mRecyclerView = (RecyclerView) findViewById(R.id.RecyclerView); mAdapter = new MyAdapter(getBaseContext(),TITLES,ICONS,NAME,EMAIL,PROFILE); mRecyclerView.setAdapter(mAdapter); mLayoutManager = new LinearLayoutManager(this); mRecyclerView.setLayoutManager(mLayoutManager); ...} @Override protected...

Crop Image Located in Internal Storage

android,image,android-intent,crop,android-fileprovider
I am having trouble using the crop intent in Android. I am storing images in the internal storage allocation for my app and I want to be able to crop them and then set them as the wallpaper. I can get it to work with an image stored in external...

Return a String from a Thread Android Java

java,android,multithreading,android-fragments,android-intent
I am using a Thread to perform an HttpURLConnection and get data from my database. The code below represents what I would like to accomplish but I get an error on the line str_Data = "John Doe"; Error: Variable 'str_Data' is accessed from within inner class public void onCreate(Bundle savedInstanceState){...

Android: Intent asks remove argument & getBaseContext() ask to create its method

android,android-intent,android-fragments
I'm trying to make 3 tabs with fragments from TabHost with Fragments and FragmentActivity and find problems with my intent in 3rd tab. I tried this method Android Remove arguments to match "intent()" but nothing change. it's still error. package com.spamcity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.Fragment; import...

RuntimeException when loading image from device and applying parallax effect

android,android-layout,android-intent,android-activity,android-xml
In my app i want to load an image from gallery or take an image using camera and i want to apply parallax scrollview effect on that image.I have an xml file called header ,it contains an image view and two buttons,one for loading image another one for taking image...

Unable to Register Android App with GCM : Not allowed to start service Intent

android,android-intent,android-gcm
Building An App using the Android Studio. There is some issue in the App configuration that throws a java.lang.SecurityException. The project is stored in https://github.com/snambi/gcm_register The AndroidManifest.xml <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" /> <uses-permission android:name="android.permission.GET_ACCOUNTS"/> <uses-permission...

I need to start activity using my SearchView widget on my actionbar

java,android,android-layout,android-intent,android-activity
I need to start up my activity SearchResultsActivity when the user presses enter on the Search Widget. I already have my onSearchRequested function being called indirectly whenever I click on my menu_search which looks like this. <item android:id="@+id/menu_search" android:title="@string/menu_search" appcompat:actionViewClass="android.support.v7.widget.SearchView" appcompat:showAsAction="always" /> Whenever I enter query and then enter/search nothing...

How to set an image on imageView from the gallery and image taken by camera in Android?

android,android-intent,android-imageview,android-bitmap
In my app I want to set an image on a Image View from gallery and I want to set an image which is taken by the camera.I have tried this code ,but when I load image from gallery ,it is working.But when I try to take a picture to...

Need assistance with the Android Manifest XML File within my Launcher App

android,android-intent,android-manifest,intentfilter,launcher
Hoping someone can point out my failure here. Ive developed a custom launcher app which I want to replace the home screen. I also want the activity accessible via a custom URL "myapp://launcher.android.com." I'd love to explain why, but to cut a long story short, the Android Gods demanded that...

Difference between PendingIntent.send(…) and Activity.startIntentSenderForResult(…)

android,android-intent
There seem to be (at least) two ways to send Intents in Android: PendingIntent.send(...) Activity.startIntentSenderForResult(PendingIntent.getIntentSender(), ...) Other than the fact that the latter only works starting API level 5 and that the results are passed back in a different way (via PendingIntent.OnFinished vs. Activity.onActivityResult(...)) is there any fundamental difference between...

Android : AlarmManager is not wroking properly. It is not able to set the alarm

android,android-intent,alarmmanager,android-pendingintent
Here is my code Code to set Alarm. This is the code I tried, but unfortunately it won't set the Alarm at all. Please help me with this. The AlarmManager is the only way I know to set alarm. Could anyone tell me if ther is some other way. I...

Use one instance of MediaPlayer throughout several fragment classes

java,android,android-intent,android-fragments,android-mediaplayer
I'm creating a soundboard android app that will use multiple fragments to display buttons that when clicked will play a sound. The code I have so far uses two instances of MediaPlayer. I have no idea how to use a single instance of MediaPlayer while still having two fragments. Here...

How to getCropAndSetWallpaperIntent(Uri imageUri) to work?

android,android-intent,uri,android-wallpaper
So, there are two questions that are the same as this( How to use getCropAndSetWallpaperIntent method in WallpaperManager? AND How to use getCropAndSetWallpaperIntent? ), but there are no answers to both of them. In hope of an answer I'm asking this - how to get this method to work. http://developer.android.com/reference/android/app/WallpaperManager.html#getCropAndSetWallpaperIntent(android.net.Uri)...

The constructor Intent(new View.OnClickListener(){}, GetLRL) is undefined

android,android-intent
I am trying to pass arrayList intent to the GETLRL class but I am getting this error: The constructor Intent(new View.OnClickListener(){}, GetLRL) is undefined How can I fix it? I appreciate any help. This code is in the MainActivity: private void createCheckboxList(final ArrayList<Integer> items) { . . . btn.setOnClickListener(new View.OnClickListener()...

Use OnclickListener In custom Adapter Class

android,android-intent,listadapter
I have to use onclick listener in custom adapter class of listview. But every time it crashes the application when I try to click on it. Here is the adapter class::- public class ClassAdapter extends BaseAdapter{ ArrayList<Class_Beans> feedList; LayoutInflater inflater; Activity activity; Context context; ImageLoader imageloader; public ClassAdapter(ArrayList<Class_Beans> feedList, Activity...

Android App crashes when intent a new activity

java,android,android-intent
I need help to find out why it wont go to the next activity (case R.id.Signin_Btn), I've got this issue in another Activity which was perfectly working before this class was made. I've been through and checked everything and cant find a way to resolve this issue. public class Login...

The method getIntent() is undefined for the type GetLRL

android,android-intent
I am trying to pass data from createCheckboxList method to the getLRL class but when I try to call getIntent in the post_selected GetLRL class I am getting this error The method getIntent() is undefined for the type GetLRL How can I fix it? createCheckboxList in the MainActivity: private void...

How to check for existing activities when back button pressed

android,android-intent,android-activity,stack
Generally, when the back button is clicked, I call finish(), and I am taken back to the previous activity (which is my MenuActivity) : @Override public void onBackPressed() { finish(); } However, sometimes the there are no other activities running when the back button is clicked and the app simply...

Save intent Extras

android,android-intent,android-activity,activity-lifecycle
I have 3 activities 1st activity calls 2nd activity and the 2nd activity calls the 3rd activity. 2nd activity uses intent extras from the 1st activity. So when I return (using actionbar back button) to 2nd activity from the 3rd activity, I get a nullpointerexception on the place where i...

Android Studio - Illegal character 8204 error

java,android,android-intent,android-fragments,android-studio
For some reason, after rebuilding my project I get an illegal character error but nothing within my code gets underlined in red. Can someone please tell me what is wrong and how to resolve it? Error illegal character: \8204 WCBankActivity.java import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.ActionBarActivity; public class...

Get IntentSender object for createChooser method in Android

android,android-intent,android-pendingintent
I would like to use new version of Intent.createChooser method which uses IntentSender. Documentation states only that I can grab it from PendingIntent instance. In my case it seems that PendingIntent won't have any other use. Is there another way to obtain IntentSender or do I need create PendingIntent?...

Import PDF from adobe

java,android,android-intent,intentservice
I am looking to do the following in andriod studio User will open his mail client and click preview on a PDF. It opens the file in adobe reader. The user makes comments in adobe and when done press share My andriod app is shown and the users selects my...

Using intent between activities, in reverse - Android

java,android,android-intent,input,android-studio
I am quite new to android programming (aswell as java in general) and have run into an issue that has me stumped. I am building a basic app (for practice) that accesses an already built website www.shodan.io . As far as i know there is no android app for this...

On Android M, how to configure the “direct-share” capabilities (image, text), and how to query the items?

android,android-intent,android-manifest,android-m,direct-share
Background According to a new feature on Android M (link here), apps outside your app can offer to give a direct sharing intent to one of its activities, allowing, for example, a chatting app to share the content to an exact contact, so you choose both the chatting-app and the...

How to determine which Activity launched current Activity in Android?

android,android-intent,android-activity
Without using an Intent and passing an extra parameter, is it possible to determine which Activity launched the current Activity?

BroadcastReciver class not running

android,android-intent,broadcastreceiver,intentfilter
I wrote a BroadcastReceiver class for receiving a broadcast intent when charger is disconnected but it does not display the Toast when I disconnect the charger. The Logcat does not show anything either. I use ADB over wifi. Please help import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.widget.Toast; public class...

How to resolve Out of Memory Error on Bitmap in Android?

android,android-intent,android-activity,bitmap
I want to set an image in image view,I am retrieving the image path in my first activity and I am passing it via intent as a String to second activity.In the second activity I set the path to an image view,It is working properly , and I need to...

opening notofication from gcmIntentClass to a fragment class

android,android-intent,android-fragments,android-gcm
I am receiving a notification from GCM ... in my GcmIntentService class I did this. Intent notificationIntent = new Intent(GcmIntentService.this, HomeActivity.class); when I tap notification I want it to open a Fragment ..... I have my Fragments in HomeActivity.class from which I want to open Message Fragment. Intent notificationIntent =...

Start intent when pitch us between 0 and 135 Android

android,android-intent,android-sensors
in this image (taken from web) that summarizes what i want to achieve in my Android app, but i have some problems. Basically when the user has the smartphone in position 1 (bottom) the phone change activity, and when the smartphone position in the 2, another activity should be active...

Android: Using an intent to start any activity

java,android,android-intent,android-activity
I have been working on an application that has a bunch of formulas in it. The user can select which formula they need to use, input the numbers/variables, and the program will return whatever answer they are looking for. Each formula has its own class and since there are so...

Notification not always starting the Activity

android,android-intent,android-activity
Per title, it doesn't always start the activity. There's no error in output log, it just says 06-01 16:46:36.924: I/ActivityManager(370): START u0 {flg=0x10000000 cmp=com.myapp/md527315440e30c82eb86ffbe7caee6cb98.MyView bnds=[96,712][1056,840] (has extras)} from pid -1 What I mean by "not always" is this: I start app, it shows the main screen. Notification is received, I...

Intent can't move to another activity using IF

android,sockets,if-statement,android-intent,client
I'm having a problem with my program. The process is when the client send a message,the server sends back a message, if the message is "OK", the client will move to the next activity but it didn't. This is my code: OnClickListener SendOnClickListener = new OnClickListener() { public void onClick(View...

Android - No suitable constructor found

java,android,android-intent,android-fragments,android-activity
After rebuilding my project I get this error: Cannot resolve constructor 'Intent(anonymous android.widget.AdapterView.OnItemClickListener,java.lang.Class>)' Does anyone what the error means, what is wrong with the constructor and how do I resolve this issue? public class FragmentWCLine extends android.support.v4.app.Fragment { public final static String EXTRA_MESSAGE = "Station_key"; private class WC { private...

Facebook API v2+. Open Facebook application (friend profile or chat page) from my android app using intent?

android,facebook,facebook-graph-api,android-intent
I try to open Facebook Android App (Chat screen) from my own app. I found that it can be possible using: intent.setData(Uri.parse("fb://messaging/" + profileId)); where profileId, it's number like this: 100001850642676 But I can't get friend Id in necessary format, because when I'm sending request to get taggable_friends I get...

android - No Activity found to handle intent action.VIEW

android,exception,android-intent,android-fragments,textview
I got an exception in my android app: 06-18 17:57:39.816 6333-6333/com.appsrox.instachat E/InputEventReceiver﹕ Exception dispatching input event. 06-18 17:57:39.816 6333-6333/com.appsrox.instachat E/MessageQueue-JNI﹕ Exception in MessageQueue callback: handleReceiveCallback 06-18 17:57:39.816 6333-6333/com.appsrox.instachat E/MessageQueue-JNI﹕ android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=href (has extras) } at...

Unable to launch list view owing to constructor error

java,android,android-intent,android-fragments,android-activity
I'm trying to get my list view to appear but it won't don't do so when running my app due to a constructor error that I don't know how to fix. How can this issue be resolved? FragmentWCLine.java public class FragmentWCLine extends android.support.v4.app.Fragment { ListView listView; private class WC {...

Pass 3D-array to Activity in Android

android,android-intent,android-activity,multidimensional-array
I am trying to pass a 3D-doublearray to another activity. I don know why I get NullpointerException? What is missing? MainActivity Intent intent = new Intent(this, DataActivity.class); Bundle mBundle = new Bundle(); mBundle.putSerializable("list", output_data); intent.putExtras(mBundle); startActivity(intent); DataActivity (reveiver) Intent intent = new Intent(); double[][][] params = (double[][][]) intent.getExtras().getSerializable("list"); And I...

Android compiles but crashes

java,android,android-layout,listview,android-intent
i am trying to develop my first app. It compiles and installs but crashes when I open it. Here is the Code public class MainActivity extends ActionBarActivity implements OnItemClickListener { private ListView listview; private DrawerLayout drawerlayout; private ActionBarDrawerToggle drawerListener; private LinearLayout menu; private myAdapter myadapter; @Override protected void onCreate(Bundle savedInstanceState)...

Start and stop recording from a button in a notification

android,android-intent
I have a notification with a "Record" button. The desired functionality is that the app will start recording with the device's microphone when the button is clicked, and stop when it is clicked again. It should behave similarly to a Play/Pause button of a music app. There are also other...

Android Intent doesnt work

java,android,android-intent
so I have these code main.java package com.example.kamusinggris_indonesiaidiom; import android.app.Activity; import android.app.SearchManager; import android.content.Context; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import android.widget.SearchView; import...

Open Map Activity from GCM Push Notification

android,android-intent,android-activity,android-gcm,android-location
I am trying to open a specific activity called 'MapActivity' where I want to load my current position on a map and get nearby places. I got that working and also got GCM working to send push notifications to my device (Android 4.3). The only problem left is opening that...

How to get position of listitem using setonitemclicklistener and send to next activity

android,listview,android-intent
In my app I am getting response from server and displayint it in listview, now what I am trying is when user click on listitem it should get position of it and need to send it to next activity, but it is not working. Following is mt snippet code btn_go.setOnClickListener(new...

Changing activity from other app android

android,android-intent,intentservice,oncreate
I want to block the opening of certain programs. Example: I have a program (A) with all the configurations (a key, list of programs to lock). When active (A), and you open a program (B) (shortscreen from android menu), if it is on the list of locked programs, instead of...

Is it possible to share multiple text by using share intent?

android,button,android-intent,share
I intend to share 6 text information, however it always shows the last information only, i.e. share.putExtra(Intent.EXTRA_TEXT, Contact); I also tried to use a string array to store all 6 information, i.e: share.putExtra(Intent.EXTRA_TEXT, stringArray); However, it still doesn't work. Can anyone help ? Thank you. My code: public class SingleJobActivity...

How are android intents handled at runtime?

android,android-intent,android-activity
I understand that intents are used to start new activities and services and can contain information about these - certain UI options, etc. They can be emitted by some activities or apps to signal that others should begin or end, or that some change should occur. I don't understand how...

how to pass data intent in different textview in android

android,android-layout,android-intent
I have 3 activities layouts. In the first layout I want the user to input a number that had displayed (almost same with captcha) and in the second layout too. Next i want to pass the result to the last layout. Here is my code. firstlayout: EditText periksaAnsTxt = (EditText)...

Getting the Foreground Activity of any application in a Service written in other application

android,android-intent,android-activity,service,intentservice
What I want is that I need the reference to the current Activity of ANY application that is on the foreground. Basically I have written a service and I want to get the reference to the "current" foreground activity in that service. With "current" I mean any application activity other...

Choosing photo using new Google Photos app is broken

android,android-intent,android-gallery,google-photos
My app has ability to select photo from library. Exactly I want file path from this selection. This is the code to create intent for selecting photo: Intent photoPickerIntent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI); photoPickerIntent.setType("image/*"); startActivityForResult(photoPickerIntent, INTENT_REQUEST_CODE_SELECT_PHOTO); This is the code that gets file path from URI: Cursor cursor = null;...

Passing Number[] array through Intent

android,arrays,android-intent,bundle,androidplot
i am struggling on passing an array from one activity to another. In my MainActivity i build an array similar to this: Number[] s1 = {1, 8, 5, 2, 7, 4}; The reason i need it in that format, is to graph those points using androidplot in the other activity....

SigninActivity is not an enclosing class

java,android,class,android-intent,android-activity
I'm trying to change the activity on "onPostExecute" but it doesn't seem to work even though it works on other activities. Here's my code: public class SigninActivity extends AsyncTask<String,Void,String>{ private TextView statusField,roleField; private Context context; private int byGetOrPost = 0; public SigninActivity(Context context,TextView statusField,TextView roleField,int flag) { this.context = context;...

Unable to get instance of Activity in Unity C#

java,c#,android,android-intent,unity3d
I've been trying to access an Activity method from Unity and cannot figure out for the life of me why it is not working. I've read various pages such as http://forum.unity3d.com/threads/call-a-method-in-an-activity-using-androidjavaobject.219950/ and http://docs.unity3d.com/460/Documentation/Manual/PluginsForAndroid.html I'm trying to create a Camera plugin for Unity. There are some plugins out there, but most...

Making a layout clickable, and start an intent

java,android,xml,exception,android-intent
I wanted to make my layout clickable, which I though would be really easy, but I stumbled into some problems.This is my xml code: <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#0D47A1" android:id="@+id/mylayout" android:clickable="true" android:onClick="layout"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:text="sometext"/> </RelativeLayout> and Java code: public void layout (View view){...

How to mock a Android NFC Tag object for unit testing

android,unit-testing,android-intent,mocking,nfc
I'm currently working on an Android project which needs NFC integration. Now I want to write some (j)unit tests to see if the application can receive NFC intents (specifically ACTION_TECH_DISCOVERED) and put the given tag (in NfcAdapter.EXTRA_TAG) on a bus system. However to my surprise I cannot create a Tag...

Starting new Activity not from the MainActivity file

android,android-intent,android-fragments,android-activity
I need to open new activity (using fragments if it's important) and I'm on a different file then the main activity so the code : Intent myIntent = new Intent(CurrentActivity.this, NextActivity.class); CurrentActivity.this.startActivity(myIntent); Is not good enough for me because I'm getting : ...is not an enclosing class ERROR referring :...

Android Intent and Intent filter

android,android-intent,intentfilter
I have a problem here with my code. I want to pass from an activity to another from a button. Here is my code: MainActivity.class ImageView imgsettings; inside onCreate() imgsettings = (ImageView) findViewById(R.id.imgviewsettings); imgsettings.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent("android.intent.action.SETTINGS")); } }); AndroidManifest <activity android:name=".AppSettings" android:label="@string/title_activity_app_settings"...

Unable to check if alarm has been set by AlarmManager

android,android-intent,service,alarmmanager
I am checking if the alarm has already been set by the AlarmManager using this answer. Following is my code snippet. boolean alarmUp = (PendingIntent.getBroadcast(MainActivity.this, 0, new Intent(MainActivity.this, AlarmReceiver.class), PendingIntent.FLAG_NO_CREATE) != null); if (alarmUp) { // alarm is set; do some stuff } Intent alarmIntent = new Intent(MainActivity.this, AlarmReceiver.class); final...

Pasing data through app after install without launching

android,android-intent
Refering to this post I need to ask something else. I have an application "A" which download and install another app "B". I want B to "transfer" data to A and then A will use this data to do work. I know that we can transfer data with intent. After...

Alarm receive don't work

android,android-intent,android-service,android-pendingintent,android-broadcast
I'm making an alarm receiver, but the alarm is not triggered. This is my code : Start alarm in MainActivity : private void setupAlarm(){ Intent intent = new Intent(this, com.logdata.AlarmReceiver.class); PendingIntent pIntent = PendingIntent.getService(this, 0, intent, 0); AlarmManager manager = (AlarmManager) getSystemService(Context.ALARM_SERVICE); manager.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,SystemClock.elapsedRealtime() + 1, 1000, pIntent); Log.e("setupAlarm", "Setup alarm...

prevent asynctask to run after intent and starting the activity

android,android-intent,android-asynctask
I have tried to prevent an asynctask to run after changing the activity through intent but even after calling finnish() the activity is still creating. I am trying to see if a user got filled the username/password or not in my application, if they are not filled it should be...

How to send a WifiP2pManager object though a Parcelable interface to another activity

android,android-intent,wifi-direct
As the title says, How can i to send WifiP2pManager and Channel objects to another activity, if possible via Parcelable interface. I am not that fluent with java and Android SDK so an example code is very much helpful. Thanks....

I'm trying to get location on android device But it crashes immediately after execution

android,android-intent,android-activity
I'm trying to get location on android device the code is as follows: private void openLocation() { lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE); Criteria c = new Criteria(); pro = lm.getBestProvider(c,false); Location l = lm.getLastKnownLocation(pro); if (l != null) { Toast.makeText(WebActivity.this, "Longitude : "+String.valueOf(l.getLongitude())+", Latitude : "+String.valueOf(l.getLatitude()), Toast.LENGTH_LONG).show(); } else { Toast.makeText(WebActivity.this,"loc object...

i need to calculate fine to pay for late submission of books in library? [closed]

android,android-layout,android-intent,android-fragments,android-activity
help me with the logical code ..starting with "difference between two dates"and if difference exceds return date we start calculating fine for every extra day ..Any help will be appreciated thanks!

Android Implicit Intent for Viewing a Video File

java,android,android-intent,uri,avd
In my Android app, I have a button that when clicked, launches the external application of my choice to play a video (I gather that this is called an "implicit intent"). Here is the relevant Java code from my onCreate method. Button button = (Button) findViewById(R.id.button); button.setOnClickListener ( new Button.OnClickListener()...

How does “this” actually provide a Context from an Activity when used in for example an Intent(this, ClassName.class)

java,android,android-intent
I know how to use intents practically, however I don't really understand What really happens when you write this and pass it as a parameter in a method from an Activity. I know that the reserved keyword this in java refers to an object. I double checked what it really...

Tag returns null when trying to write NDEF message to NFC tag - Tag is not detected

android,android-intent,tags,nfc,ndef
I am trying to write an NDEF message to a tag. Below is the code that I have. I run the code using the debugger in my IDE, but after executing the line Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG); tag is null (I assume this means that no tag was found) and...

take screenshot from layout and share via android

android,android-intent,bitmap
I use below code to take screen shot from my layout and share it via android intent but the captured screen shot in the selected app is not showing any thing. @Override public void onClick(View view) { shareBitmap(this,takeScreenshot()); } public Bitmap takeScreenshot() { try{ View rootView = getWindow().getDecorView().findViewById(R.id.lyt_main_report_activity); rootView.setDrawingCacheEnabled(true); return...

Android: Edit an image by 3rd party app / Intent ACTION_EDIT

android,cordova,android-intent
I'd like to use 3rd party apps like Skitch to "annotate" photos taken in my app and, of course, have the updated photo saved back to my app. The photos are stored in the private directories of my app and are exposed via a ContentProvider. The Intent to open a...

How do I avoid multiple apk install promps on an Android programmatic install?

android,android-intent,apk
Our Android applications automatically check for updates every 5 minutes in the background and downloads the latest .apk file from our downloads server. It then fires off an install using the below method: public static void installDownloadedApplication(Context context) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); File sdcard = Environment.getExternalStorageDirectory(); File...

how to launch an image in a activity by clicking a button in a diffrent activity in android studio

android,android-intent,android-studio
I have different text view in the main activity and each one when clicked leads to another activity. All of them but the first one are disabled. The process should be, when being done with the first activity click the done button and it enables the next text view and...

How do I configure my AlarmReceiver to actually trigger at my desired interval?

android,android-intent,alarmmanager,android-alarms,repeatingalarm
The goal for this portion of my app is to run a repeating alarm in the background at all times that grabs a new prediction every 15 minutes from a server side machine learning algorithm, updating the app. I currently have the skeleton for this desired behavior implemented, to make...

I want to Show Simple Toast Message When User Click On Media Controller button Pause/Start/Stop in video View Using Media Controller

android,android-layout,android-intent,android-fragments,android-activity
My Java Code and I know How To Play / Stop / Pause Video videoView=(VideoView)findViewById(R.id.videoView); // Video from raw Folder mediaController = new MediaController(this); uri = Uri.parse("android.resource://" + getPackageName() + "/"+ R.raw.abc); videoView.setVideoURI(uri); mediaController.setMediaPlayer(videoView); videoView.setMediaController(mediaController); videoView.requestFocus(); videoView.start(); ...

Clear back stack but keep transition animations

android,android-intent
My application scenario looks like this : MainActivity > TaskActivity > TaskActivity > TaskActivity > ... > MainActivity Each TaskActivity launches next one depending on the user content is able to go back to MainActivity Previous activities do not need to be kept in back stack. Actually I want them...

Getting arguments from a bundle

android,android-intent,android-fragments
I'm trying to pass arguments from my Activity to a Fragment and I'm using this code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail); String message = getIntent().getStringExtra(Intent.EXTRA_TEXT); DetailActivityFragment fragment = new DetailActivityFragment(); Bundle bundle = new Bundle(); bundle.putString(INTENT_EXTRA, message); fragment.setArguments(bundle); } I'm getting the value of the message variable...

Broadcast intent vs multicast listener implementation on Android

android,android-intent,listener,broadcast
I want to enable for several objects to subscribe to an event at the same time. Currently I see two approaches: to send broadcast intents, or to implement multicast listeners (a manager class containing an array of the subscribed listeners, and with subscribing and unsubscribing functionality) such as the built-in...

how to fetch all column Values based on Email

android,sqlite,android-intent,homescreen
I want to fetch my all the column from table tblReg, It has column Registration,Name,Password,Email and Contact out which Email is checked while registration ,it is unique column.. value exist only once in table of one Email. I am having login by matching Email with password and passing value of...

Back to a fragment from fragmentActivity in Android

android,android-intent,android-fragments,android-fragmentactivity
I'm trying to get back to a fragment from a fragmentActivity, but it is not working, I'm getting NullPointerException, When I hit cancel I need to update the previous fragment. How can I get back to a fragment and update it? don't know why this is happening. public class AddEscolas...

Android Notification: Intent.FLAG_ACTIVITY_NEW_TASK required?

android,android-intent,notifications
In the document of the Notification class I see this: public PendingIntent contentIntent The intent to execute when the expanded status entry is clicked. If this is an activity, it must include the FLAG_ACTIVITY_NEW_TASK flag, which requires that you take care of task management as described in the Tasks and...

Implementing a File Picker in Android and replicating the selected file at another location

android,android-intent,android-file,android-fileprovider,android-implicit-intent
I'm trying to implement a File Picker in my Android project. What I've been able to do so far is : Intent chooseFile; Intent intent; chooseFile = new Intent(Intent.ACTION_GET_CONTENT); chooseFile.setType("*/*"); intent = Intent.createChooser(chooseFile, "Choose a file"); startActivityForResult(intent, PICKFILE_RESULT_CODE); And then in my onActivityResult() switch(requestCode){ case PICKFILE_RESULT_CODE: if(resultCode==-1){ Uri uri =...

Bluetooth pairing - how to show the simple Cancel/Pair dialog?

android,android-intent,bluetooth,android-bluetooth,bluetooth-oob
I have prepared a simple test project for this question at GitHub. I am trying to create an Android app, which would scan a QR code from a computer screen and then use the data (MAC address and PIN or hash) for easy pairing (bonding) with a Bluetooth device. Similar...

How to open “zxing Barcode” scanning screen in a small window?

android,android-intent,android-camera,zxing,barcode-scanner
"zxing Barcode" scanner is successfully working in my App https://github.com/journeyapps/zxing-android-embedded I want to open the scanning screen (i.e., Intent), on same Activity in the center in a small window How can I get this type of Interface ? http://i.stack.imgur.com/bpT5R.jpg...

Android parentActivity not getting recreated after startActivityForResult returns

android,android-intent,android-fragments,android-activity
I have a MainActivity and inside it, I am loading a fragment A. From FragmentA , I am calling google placepicker activity using startActivityforResult as follows. PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder(); Intent intent = builder.build(getActivity()); getActivity().startActivityForResult(intent,PLACE_PICKER_REQUEST); But when I select place, onActivityResult(either in FragmentA or MainActivity) is not getting called....

Sync Adapter not calling onCreate

android,android-intent,android-activity,android-service,android-syncadapter
Do we need to start the Sync Adapter service or framework starts implicitly? I have put a log on Constructor, onCreate, onDestroy of Sync Adapter service and when I start the app, I don't see the logs in the logcat. But when I do on activity onCreate Intent serviceIntent =...

Android - No view found for fragment

java,android,android-intent,android-fragments,android-activity
I'm trying to get my replaced fragment to appear in the detail fragment but after debugging my app on a tablet emulator and selecting the necessary list view item, the log cat gives me this error: Caused by: java.lang.IllegalArgumentException: No view found for id 0x7f0c0050 (com.apptacularapps.exitsexpertlondonlite:id/detail_container) for fragment FragmentWCBank{3b4ea8fb #0...

Sending Intent from BroadcastReceiver class to currently running activity

android,android-intent,android-activity,android-bundle
I have a class which extends BroadcastReceiver. On receiving a SMS, I would like to pass information to my main activity class to display the text in a box (Append, if already text is present). public class SmsReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Intent...

Is it possible to know whether another app is in background or foreground?

android,android-intent
I'm going to develop a task manager app. But before starting, I want to know my app can detect other applications status or not? for example are they in running background or they are in foreground? Does Android system provide some methods to determine this?...

Multiple notification handling

android,android-intent,notifications,android-pendingintent
I'm having trouble in figuring out the Intent, PendingIntent Filters and Flags for notifications. Notification are working and are getting generated as they should, but the problem is only the last notification created keeps the Bundle Data. I want all notification to keep the Bundle Data of each notification in...

Passing HashMap using intent returns null, why?

java,android,android-intent,hashmap
I'm trying to pass a hashmap from one activity to another using intent. I already found a solution which should work. I implemented Serializable in class Player. private HashMap<Integer, Player> players = new HashMap<Integer, Player>(); players.put(1, new Player("name")); Intent intent = new Intent(this, GameActivity.class); intent.putExtra("players", players); startActivity(intent); But when I...

Is it secure to pass PIN via bundle/extras in Android?

android,android-intent,android-activity,android-bundle
I need to ask the user to enter his app pin and confirm that pin by entering it again. I am not going to save that pin on the device and will sent it on server as soon as I get it. While implementing confirmation screen, this question came into...

open application After incoming or outgoing call diconnection

android,android-intent,android-listview,broadcastreceiver
I am creating an application, where I am getting call history in a listview, now what I am trying is after any incoming or outgoing call disconnection,I want to open that listview, but I don't know my app is not opening. my listview page is not displayed after any call,...

Cannot start activity using explicit intent

android,android-intent
I have Starter ListActivity which starts two others: Multitouch and Accelerometer. When the first one is touched in ListActivity it is launched very well. The second one, however, isn`t laucnched. Logcat reports: 06-09 22:42:55.293 12227-12227/com.mainpackage.api E/AndroidRuntime﹕ FATAL EXCEPTION: main android.content.ActivityNotFoundException: Unable to find explicit activity class {com.mainpackage.api/com.mainpackage.api.Accelerometer}; have you declared...

Launching email client programatically in android and passing email address to client

android,email,android-intent
In my app I have a contacts page that when the user clicks on the contacts name a drop down appears with the email and phone number of the contact. I am launching the email client in the onClick method of the text view that contains the email address, using...

Simplest way to use / create a PendingIntent

android,android-intent,android-pendingintent
Maybe there's something really simple that I don't see. I'm trying to call a method from some API, and this method asks for a PendingIntent to send me asynchronously some value. I've read the doc and examples for half an hour, and can't wrap my head around a simple way...

Android Receive SMS Intent: Get Message Id or Thread Id

android,android-intent,telephony,smsmanager
I have register a Broadcast listener to receive the android.provider.Telephony.SMS_DELIVER Intent action. I seem to be able to get the body, and sender phone number of this new message. However I am not able to get the Message Id or Thread Id of this new message. The only way I...

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

android,android-layout,android-intent,android-activity
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...

How to click song list (Now Playing activity) to playing without (Music Preview) startActivity

java,android,android-intent,android-activity,android-developer-api
How to click and send (Intent + putExtras + startActivity) in main activity (music preview activity) and playing song without showing it. Song list stays, but clicking list song --> refresh music preview activity. I want stay this activity (song list) but music priview activity get intent and refreshing and...

How to access navigation drawer in all activities?

android,android-intent,android-fragments,navigation-drawer
I am following this tutorial http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/ Now This is my fragment,and here I am able to see navigation drawer,Now from this fragment I Intent to next activity and I want to display navigation drawer in that activity public class WhatsHotFragment extends Fragment { public WhatsHotFragment(){} @Override public View onCreateView(LayoutInflater inflater,...