android-intent

How to make an implicit intent explicit?

萝らか妹 提交于 2019-12-23 02:43:22
问题 I have two applications, A and B, which use a android library C. B has a service A wants to use via C, e.g. <service android:name="my.package.in.a.service.ConnectorService" android:exported="true"> <intent-filter> <action android:name="my.package.in.a.action.START_A"/> </intent-filter> </service> In my library there is a class which tries to bind it to the service, e.g. Intent intent = new Intent("my.package.in.a.service.ConnectorService"); /** establish a connection with the service. */

How to attach audio file to MMS in Android?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 02:42:32
问题 I want to attach audio file to MMS.How to do that?I found a lot on SO as well as on Goggle but still not got rhe right solution yet.So someone help me for my this issue.My code is as: Intent sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.setType("audio/mp3"); sendIntent.putExtra("sms_body", getResources().getText(R.string.Message)); sendIntent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity"); AssetManager mngr = getAssets(); InputStream path = null; try {

working with android intents how to pass arguments between father and the intent h in

百般思念 提交于 2019-12-23 02:42:31
问题 Assuming i want to open another activity from my current activity and i want to pass arguments such as in my case difficulty level how do I do it? newGameButton.setOnClickListener(new OnClickListener() { public void onClick(View view) { Intent i = new Intent(countryCityGameMenu.this,GameScreen.class); startActivityForResult(i, GlobalDataStore.STATIC_INTEGER_VALUE); } }); is there a way to pass those arguments in the calling ? can someone show an example explaining what send activity should do

How to open Youtube App directly via intent [duplicate]

元气小坏坏 提交于 2019-12-23 02:38:50
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Android YouTube app Play Video Intent I wanted to know how to open Youtube App on Android directly using intent. What i have: @Override public void onClick(View v) { String video_path = "http://www.youtube.com/user/videoslusofona"; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(video_path)); startActivity(intent); } What i don't want is for Android to ask me what App i want to open, i want to open

Android Training Sample- Scheduler Sample- unable to stop alarm

浪子不回头ぞ 提交于 2019-12-23 02:34:26
问题 I am using the sample code(Scheduler.zip) available on the Android developer training website- http://developer.android.com/training/scheduling/index.html Here's the code:- MainActivity.java /* * Copyright 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by

Launching Android Weather App Via Intent

时光怂恿深爱的人放手 提交于 2019-12-23 02:32:26
问题 I want to launch the stock weather app from my android app via an intent, but I keep getting a force close runtime error, and LogCat gives me nothing. The code I am trying to use to achieve this is: public void startWeatherActivity() { Intent intent = new Intent("android.intent.action.MAIN"); intent.setComponent(ComponentName.unflattenFromString("org.anddev.android.weatherforecast/ org.anddev.android.weatherforecast.WeatherForecast")); intent.addCategory("android.intent.category.LAUNCHER");

stop called in an invalid state: 1

泪湿孤枕 提交于 2019-12-23 01:59:29
问题 I am trying to build a call recorder in android. I am using the MediaRecorder Class: When My App reaches the following line: recorder.stop() I get the following error: stop called in an invalid state: 1 What causes that problem? Thanks in advance, kobi 回答1: From the MediaRecorder documents page: http://developer.android.com/reference/android/media/MediaRecorder.html Looking at the state diagram given, you can only call stop() when the MediaRecorder is in the state Recording Hard to tell what

Android Calendar timezone not changing with CalendarContract

扶醉桌前 提交于 2019-12-23 01:51:17
问题 I am using the following code to add an event to the calender Intent intent = new Intent(Intent.ACTION_INSERT); intent.setType("vnd.android.cursor.item/event"); intent.putExtra(Events.TITLE, "my event title"); intent.putExtra(Events.EVENT_LOCATION, "my city"); intent.putExtra(Events.DESCRIPTION, "description of this event"); intent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, dep.getTimeInMillis()); intent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, arr.getTimeInMillis()); intent

SMS Broadcast Receiver without Manifest

时光怂恿深爱的人放手 提交于 2019-12-23 01:38:32
问题 Wondering how I would go about creating an SMS Broadcast Receiver without using the Manifest file. So for instance, this is my current manifest file line: <receiver android:name="com.paradopolis.randomnotifications.SMSListener"> <intent-filter> <action android:name="android.provider.Telephony.SMS_RECEIVED" /> </intent-filter> </receiver> and it's working fine, but I'd like to be able to remove the line and register my broadcast receiver within my service like: registerReceiver(new SMSListener

Xamarin Android: using StartActivityForResult(); resultCode in OnActivityResult is always “Canceled”

前提是你 提交于 2019-12-23 01:14:28
问题 I have two separate applications written using Xamarin.Android; for the sake of discussion, let's call them "Tristan" and "Isolde". Tristan has some state information that Isolde sometimes needs to know. Complication: Tristan may or may not be running at the moment Isolde develops the need to know his state. I've got kludge working now where Isolde sends a special launch intent to Tristan, who then uses a broadcast intent to send information back to Isolde. (See my earlier question for