intent

How to do multiple intents?

匿名 (未验证) 提交于 2019-12-03 01:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to do 3 intents to start a new activity, however I find that I always get an error. I'm putting my code onto main.java code: public class Main extends Activity { Button service; Button gallery; Button contact; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); service = (Button)findViewById(R.id.Services); service.setOnClickListener(new View.OnClickListener() { }); gallery = (Button)findViewById(R.id.Gallery); gallery.setOnClickListener(new View

Android GPS proximity alert not working

匿名 (未验证) 提交于 2019-12-03 01:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to set up the most basic proximity alert, but nothing seems to happen. I'm fairly new to Android programming, so please let me know what I'm doing wrong or what am I missing. I got inspired from some source codes out here and this one . Here's my code: package com.example.proximityalert; import android.location.LocationManager; import android.os.Bundle; import android.app.Activity; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; public class

MediaStore.EXTRA_OUTPUT renders data null, other way to save photos?

匿名 (未验证) 提交于 2019-12-03 01:07:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Google offers this versatile code for taking photos via an intent: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // create Intent to take a picture and return control to the calling application Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE); // create a file to save the image intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); // set the image file name // start the image capture Intent

java.lang.numberformatexception: invalid double: “ ”

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: getting an error of invalid Double java.lang.numberformatexception invalid double: "" what is the reason for this Activity 1 package com.example.solarcalculator; import android.os.Bundle; import android.widget.Button; import android.annotation.SuppressLint; import android.app.Activity; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.EditText; import android.app.AlertDialog; import android.content.Intent; @SuppressLint("UseValueOf") public class MainActivity extends Activity

send track informations via A2DP/AVRCP

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to send track informations via A2DP/AVRCP. Right now, music is perfectly streamed, but on the "receiver" (ie: car audio), the "track informations screen" is blank (which is not the case using popular players out there). Any idea ? 回答1: This code worked for me: private static final String AVRCP_PLAYSTATE_CHANGED = "com.android.music.playstatechanged"; private static final String AVRCP_META_CHANGED = "com.android.music.metachanged"; private void bluetoothNotifyChange(String what) { Intent i = new Intent(what); i.putExtra("id", Long

Android Splash Screen

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: this is what i have in my package explorer so lets start from the top and work our way around to the problem where i think it is located.. MainActivity.java - package com . drg . idoser ; import android . os . Bundle ; import android . app . Activity ; import android . view . Menu ; public class MainActivity extends Activity { @Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ); setContentView ( R . layout . activity_main ); } @Override public boolean onCreateOptionsMenu ( Menu menu ) { /

Android Overriding onBackPressed()

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is it possible to override onBackPressed() for only one activity ? On back button click I want to call a dialog on a specific Activity, but in all other activities i want it to work as it worked before (going to previous activities) . . . Thanks For your anwsers in advance. EDITED Thank you everyone for your anwsers, I already had everything like you told me, but my problem was that when i was clicking back button on another Activity, I was going to my previous Activity (The one where i had back button Overriden) and i thought that it wasn't

How to use support FileProvider for sharing content to other apps?

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm looking for a way to correctly share (not OPEN) an internal file with external application using Android Support library's FileProvider . Following the example on the docs, and using ShareCompat to share a file to other apps as follows: ShareCompat.IntentBuilder.from(activity) .setStream(uri) // uri from FileProvider .setType("text/html") .getIntent() .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) does not work, since the FLAG_GRANT_READ_URI_PERMISSION only grants permission for the Uri specified on the data of the intent, not the

Allow all 'market://' links from inside a webview to open Google Play store

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have some links in my webview that are market:// links. When my users tap on them, it gives them a page cannot be found error. How can I allow all links that begin with market:// to automatically open the Google play store when they are tapped? I tried: final Intent intent = new Intent("android.intent.action.VIEW"); intent.setData(Uri.parse("market://details?id=")); startActivity(intent); } but that didn't seem to do anything. I am pretty new to this so any help would be appreciated. Also, FYI, I cannot change the market:// links to play

Upload Intent function Dialogflow V2

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to develop an API to upload the intent to Dialogflow V2. I have tried below snippet, which it is not working however if trying to communicate with Dialogflow it does work (detect intent)and does get a reply from the Dialogflow for queries. PERMISSION I AM & ADMIN > SERVICE ACCOUNTS > DIALOGFLOW ADMIN ERROR Error: 7 PERMISSION_DENIED: IAM permission 'dialogflow.entityTypes.create' on 'projects/dexter-47332/agent' denied. BLOGS/ REFERENCES Dialogflow easy way for authorization https://github.com/dialogflow/dialogflow-nodejs-client