android-intent

Create reminder in android app

孤街醉人 提交于 2020-01-06 14:18:31
问题 I am trying to create a weekly reminder in my app. For this I am using AlarmManager. Here is the code generating alarm pendingIntent = PendingIntent.getBroadcast(SettingsActivity.this, 1234567, new Intent(SettingsActivity.this, WeeklyReminder.class), 0); AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(System.currentTimeMillis()); calendar.add(Calendar.SECOND, 30); long updateFreq = 30*1000;//24*60

Create reminder in android app

时光毁灭记忆、已成空白 提交于 2020-01-06 14:18:05
问题 I am trying to create a weekly reminder in my app. For this I am using AlarmManager. Here is the code generating alarm pendingIntent = PendingIntent.getBroadcast(SettingsActivity.this, 1234567, new Intent(SettingsActivity.this, WeeklyReminder.class), 0); AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(System.currentTimeMillis()); calendar.add(Calendar.SECOND, 30); long updateFreq = 30*1000;//24*60

Parcelable custom handler, message never received

百般思念 提交于 2020-01-06 13:58:46
问题 I want to parcelable a Handler object to send it by a Bundle from one Activity to a service in order to get some info from this service. Right now, to test it it's a simple message. Here's the code in the Activity: private MyHandler mHandlerSharing = new MyHandler() { public void handleMessage(Message msg) { // this line in the Activity is never reached when debugging String data = msg.getData().getString("data"); Toast.makeText(mContext, data, Toast.LENGTH_SHORT).show(); } }; // in some

Sending message to Multiple Persons using send intent android

丶灬走出姿态 提交于 2020-01-06 13:57:15
问题 I am trying to use the android share intent from my application. I have listed all the contacts from my contacts content provider in my application. Now i want to send message to all the contacts i have selected(in my app) using any of the message app installed in user phone. I do not want to user smsmaanger , simply want to user any sms sending application in user mobile if available. I tried to do with email works great but not with sms . I tried with email as works great public static void

How to authenticate when using VideoPlayer?

不羁的心 提交于 2020-01-06 13:53:07
问题 I am implementing the following solution Play a video in Glass Intent i = new Intent(); i.setAction("com.google.glass.action.VIDEOPLAYER"); i.putExtra("video_url", "..."); startActivity(i); But I am getting hit with a 401 error. To authenticate I need to include my key/value pair in header. How do I go about doing that, with intents? 10-16 14:58:55.229 126-10199/? I/ChromiumHTTPDataSourceSupport﹕ Server responded with http status 401 10-16 14:58:55.229 126-10470/? I/AwesomePlayer﹕

TabActivity that create an intent onClick button but the tabhost of activity receiver disappear

﹥>﹥吖頭↗ 提交于 2020-01-06 13:52:51
问题 I have 2 activity: A, B. The first is an TabActivity and the second an Activity. Inside A i have a clickable button that make an intent to call the other activity. public class A extends TabActivity implements OnClickListener { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); tabHost = getTabHost(); tabHost.addTab(tabHost.newTabSpec("a").setContent(R.id.a).setIndicator("a")); b = new Intent(this,B.class); tabHost.addTab

How to authenticate when using VideoPlayer?

ぃ、小莉子 提交于 2020-01-06 13:51:49
问题 I am implementing the following solution Play a video in Glass Intent i = new Intent(); i.setAction("com.google.glass.action.VIDEOPLAYER"); i.putExtra("video_url", "..."); startActivity(i); But I am getting hit with a 401 error. To authenticate I need to include my key/value pair in header. How do I go about doing that, with intents? 10-16 14:58:55.229 126-10199/? I/ChromiumHTTPDataSourceSupport﹕ Server responded with http status 401 10-16 14:58:55.229 126-10470/? I/AwesomePlayer﹕

Start Activity with MapFragment from another Activity

99封情书 提交于 2020-01-06 12:53:08
问题 I developed an application and I need to start a new activity from my menu with a simple button. I made several tests and noticed that if I set the intent-filter of Activity that contains the MapFragment as follows: <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> this works fine without any crashes. If instead modify the intent-filter in such a way as not to start the Activity soon as you open the app and in particular the edit

Intent extras don't seem to refresh

醉酒当歌 提交于 2020-01-06 08:14:30
问题 When I press the button it calls a method which gets user input and sets it to a variable, then that variable is put to an intent extra and sent to BroadcastReceiver which decides what to do depending on that value. It only works the first time, on all the next presses intent extra value isn't changed no matter if that variable value changes. It forever holds the value which is set at the first press. How to rewrite intent extra with a new value? How I set the extra: Intent intentForReceiver

Accessing the phonebook on Galaxy S crashes the app

自作多情 提交于 2020-01-06 07:12:50
问题 Does anyone know how to access the contacts from the Galaxy S? I have this line of code: Intent intent = new Intent(Intent.ACTION_VIEW, Contacts.CONTENT_URI); startActivity(intent); and it works on the emulator as well as on the Samsung i5700. I tried running my app on Samsung i9000 (Galaxy S) but it crashes. I am getting the following error from LogCat: 08-23 11:28:19.511: INFO/ActivityManager(2234): Starting activity: Intent { act=android.intent.action.VIEW dat=content://com.android