intent

Android Fail to connect to camera service

匿名 (未验证) 提交于 2019-12-03 09:13:36
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When the user click on Camera, it open next screen after few seconds it throws Fail to connect to camera service and it say cannot connect to camera This is my code: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); View viewLoad = LayoutInflater.from(CameraActivity.this).inflate(R.layout.camera, null); setContentView(viewLoad); Bundle bundle = this.getIntent().getExtras(); seletctedRetailer = bundle.getString("RetailerName"); retailerCode = bundle.getString("RetailerCode"); Intent cameraIntent = new

How to switch between activities

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In my app I have three activity as Activity 1 Activity 2 Activity 3 How to switch between activities. So how can this be done? public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.settingOpt: Intent intent = new Intent(this, SettingsForm.class); this.startActivity(intent); this.finish(); break; case R.id.reminderOpt: Intent intentR = new Intent(this, ReminderForm.class); this.startActivity(intentR); break; case R.id.helpOpt: Intent intentH = new Intent(this, HelpForm.class); this.startActivity(intentH);

Android: Share plain text using intent (to all messaging apps)

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to share some text using an intent: Intent i = new Intent(android.content.Intent.ACTION_SEND); i.setType("text/plain"); i.putExtra(android.content.Intent.EXTRA_TEXT, "TEXT"); and warping with chooser: startActivity(Intent.createChooser(sms, getResources().getString(R.string.share_using))); it works! but only for email app. what I need is a general intent for all messaging app: emails, sms, IM (Whatsapp, Viber, Gmail, SMS...) tried using android.content.Intent.ACTION_VIEW and tried using i.setType("vnd.android-dir/mms-sms");

Saving Camera Intent Image To Internal Data Custom Directory

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My Problem I have a camera intent which I want the image to be saved to a directory in my internal data directory. I have created the directory using: File mydir3 = new File(this.getApplicationContext().getFilesDir(),File.separator+"MyApplication"+File.separator+CCPhotoManager.DIRECTORY+File.separator+PhotoManager); mydir3.mkdirs(); I then proceed to create the file with the specified name as you can see below. String filePath = this.getApplicationContext().getFilesDir()+File.separator+"MyApplication"+File.separator+PhotoManager+File

How to launch front camera with intent?

匿名 (未验证) 提交于 2019-12-03 09:05:37
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using an intent to open the camera with the native application: Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); Uri photoUri = Uri.fromFile(getOutputPhotoFile()); intent.putExtra(MediaStore.EXTRA_OUTPUT, photoUri); startActivityForResult(intent, CAMERA_PHOTO_REQUEST_CODE); Every time the camera that is opened (front/back camera) is like the last time this native camera application was open. Meaning that if the last time I closed the native camera application the back camera was active, so when I launch the intent for camera,

Manifest merger failed with multiple errors while updating to API 26 in android

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I tried updating my gradle with API 26 ( Android Studio 2.3.3 ). But I am getting the following error while compiling the project. Here is the screenshot of the error I am getting: Application level build.gradle : // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.3' classpath "io.realm:realm-gradle-plugin:3.5.0" // NOTE: Do not place your application dependencies here; they belong // in the

Cannot find symbol method startActivity(android.content.Intent)

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am a beginner in making android applications. I have made a web view which shows my web page. My web page consists contact buttons that i want to be opened in external apps like mail and dial. Therefore i got some help and got a code like this import android . app . Activity ; import android . content . Intent ; import android . net . MailTo ; import android . net . Uri ; import android . os . Bundle ; import android . webkit . WebView ; import android . webkit . WebViewClient ; public class ourViewClient extends WebViewClient {

Android Multiple Notifications and with multiple intents

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a fairly simple app that takes the input from a user and then sets it as a notification. The user can create as many notifications as he/she likes. I want the user to click the notification and get taken to a new activity called ResultActivity . ResultActivity in turn reads in the putExtras from the notifications intent and shows it to the user. The code below allows me to do almost everything I wanted, except anytime a notification is pressed, I receive the putExtra of the last created notification. Intent notificationIntent = new

Android: AlarmManager used to call a Service to notify the user

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Edit Adding this line in my manifest solved my problem (the Service is well created). <service android:name=".TimersService" > Post I'm currently trying to implement alarms to notify the user that a countdown has finished. I have a method createAlarm() that adds a new Alarm through an AlarmManager . This method is currently called inside a Fragment. It looks like this: private final void createAlarm(String name, long milliInFuture) { Intent myIntent = new Intent(getActivity().getApplication(), TimersService.class); AlarmManager alarmManager

BroadcastReceiver is not working

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have implemented this broadcast reciever: public class ServiceManager extends BroadcastReceiver { private final String BOOT_ACTION = "android.intent.action.BOOT_COMPLETED"; private final String BOOT_ACTION_FIRST_LAUNCH = "android.intent.action.PACKAGE_FIRST_LAUNCH"; private final String BOOT_ACTION_RESTARTED = "android.intent.action.PACKAGE_RESTARTED"; @Override public void onReceive(Context context, Intent intent) { // All registered broadcasts are received by this String action = intent.getAction(); if (action.equalsIgnoreCase(BOOT