android-intent

External service can not be resolved by intent filter

浪尽此生 提交于 2019-12-25 07:19:00
问题 I am missing something essential or... I have two applications, one of them containing exported service with intent filter declared in AndroidManifest: <service android:name=".MyService" android:exported="true" android:permission="my.permission" > <intent-filter> <action android:name="my.service" /> </intent-filter> </service> I can successfully bind to that service from another application by using "my.service" action. But I want to start service (send command to it). If I write: Intent

Android : Share drawable resource with other apps

徘徊边缘 提交于 2019-12-25 07:04:29
问题 In my activity I have an ImageView. I want ,when user click on it, a dialog opens (like intent dialogs) that show list of apps which can open image than user can choose a app and show the image with that app. my activity code : @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ImageView iv = (ImageView) findViewById(R.id.imageid); iv.setImageResource(R.drawable.dish); iv.setOnClickListener(new View.OnClickListener

AVD tool / app to monitor or debug INTENT calls

二次信任 提交于 2019-12-25 07:04:05
问题 Before I start to write one I'm looking for an existing App I can push to an AVD image that will act as a dummy / default receiver for as many of the common mime types as possible. The idea is to test a successful Share without having to push the build to a physical device or knife and fork a specific app to the emulator. The standard AVD images are brilliant for testing the: "No apps can perform this action" path through my code, but not a positive share. 回答1: As a stopgap and per my comment

Intent does not work in case of if else

时光总嘲笑我的痴心妄想 提交于 2019-12-25 06:58:09
问题 Here is my sample code: String checkin = imageUpload.getStatus(); if (checkin.equals("1")) { Toast.makeText(FullImageActivity.this, name+" "+ "Checked In", Toast.LENGTH_LONG).show(); Intent i = new Intent(FullImageActivity.this, MainActivity.class); startActivity(i); //openCamera.setText("CheckOut"); } else if (checkin.equals("0")){ Toast.makeText(getApplicationContext(), name + " " + "Checked Out", Toast.LENGTH_LONG).show(); Intent intent = new Intent(getApplicationContext(), MainActivity

String not passing to second Android activity

自作多情 提交于 2019-12-25 06:53:08
问题 I'm trying to start a new activity in my android app, and I'm trying to pass a simple string from the first activity to the second activity. I want the string to display in a textview for now in the second activity, but it just won't work. What am I doing wrong? The initial activity: package com.amritayalur.mypowerschool; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.text.method.ScrollingMovementMethod; import android.view.Gravity; import

Problems with BroadcastReceiver and multiple proximity alerts

家住魔仙堡 提交于 2019-12-25 06:52:47
问题 I realize this question already exists, but I am having trouble implementing the solutions. I'm using these questions as guidlines: multiple proximity alert based on a service set 2 proximity alerts with the same broadcast Where I register the receiver: final String NEAR_YOU_INTENT = "neighborhood.crodgers.example.activities.PROXIMITY_ALERT"; IntentFilter filter = new IntentFilter(NEAR_YOU_INTENT); registerReceiver(new LocationReceiver(), filter); Where the proximity alerts are added (Note:

Can I use a Toast for the CountDownTimer

六月ゝ 毕业季﹏ 提交于 2019-12-25 06:39:16
问题 I want to use a Toast inside the CountdownTimer, but the problem is the Toast counts too slow and when the new Activity stars the Toast isn't finished counting.I know it is easier to use a TextView but I just wanted to know if it is possible.Any ideas? @Override public void onClick(View arg0) { // TODO Auto-generated method stub if(Edt.getText().toString().length() == 0){ Toast.makeText(MainActivity.this,"What, bro?",Toast.LENGTH_LONG).show(); }else if(sec.getText().toString().length() == 0){

how to change selected contact image on button click from imageview.?

亡梦爱人 提交于 2019-12-25 06:38:18
问题 in main activity display list of contact. now select any contact and open Detail.java Activity. now i want to set this particular selected contact image from second activity imageview. mainActivity.java public class MainActivity extends Activity { SimpleCursorAdapter mAdapter; MatrixCursor mMatrixCursor; Bitmap bitmap; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // The contacts from the contacts

Android: can't pass variable to a third activity

只愿长相守 提交于 2019-12-25 06:36:24
问题 I have three activities: login choice entry I Must pass the var "Name" from login to choice (and this work well) and then,from choice to entry,and this is where i have the problem :/ I can pass name to choice,but when i try to pass it to entry,i can't! It's strange because if I pass the variable directly from login to entry, it works :/ So: login –> entry works! login –> choice works! choice –> entry not works! This is the code to pass from login to choice Intent intent; String pkg

Using AlarmManager to sync data with a server

与世无争的帅哥 提交于 2019-12-25 06:20:57
问题 First of all, I apologize for my English. I need to sent data to a server and query for data in that server from time to time, maybe from week to week. So I'm going to use the AlarmManager to do that. I wanna know if I can register two separated pending intents in the alarm manager, one to push data to the server, and another one to query data from the server. Can I register those two intents every time the application executes? Or do I need to test if I already got those intents registered?