toast

Detecting Webview Error and Show Message

匿名 (未验证) 提交于 2019-12-03 01:32:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'd like to show an error message when there is an error loading a webview page (No connection). This is what I have so far, without the error handling code: public class TrackerPage extends Activity { // @Override private WebView webview ; private ProgressDialog progressDialog ; private boolean error ; @Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ); // Get rid of the android title bar requestWindowFeature ( Window . FEATURE_NO_TITLE ); // Set the XML layout setContentView

Android Spinner Selected Item

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am populating a spinner from the database like this // Populating the City Spinner Cursor cities = db.cityList(); startManagingCursor(cities); // create an array to specify which fields we want to display String[] from = new String[] { DBAdapter.KEY_NAME }; // create an array of the display item we want to bind our data to int[] to = new int[] { android.R.id.text1 }; Spinner cityList = (Spinner) this.findViewById(R.id.citySpiner); SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, android.R.layout.simple_spinner_item, cities, from

Google sign in failed com.google.android.gms.common.api.ApiException: 10:

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: So I'm Stuck on this frustrating issue. I am quite new to Google Auth on Firebase but I done everything the firebase docs instructed in how to integrate the Google SignIn Auth, yet I'm still receiving this weird Error in the console consisted of two parts: 12-03 11:07:40.090 2574-3478/com.google.android.gms E/TokenRequestor: You have wrong OAuth2 related configurations, please check. Detailed error: UNREGISTERED_ON_API_CONSOLE and also Google sign in failed com.google.android.gms.common.api.ApiException: 10: Before Anyone attempts to point

Drop_caches by app doesn't work

匿名 (未验证) 提交于 2019-12-03 01:26:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've made this script but doesn't work: package com.mkyong.android; import android.annotation.SuppressLint; import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.Toast; import java.io.IOException; import com.example.toast.R; public class MainActivity extends Activity { private Button button; public void onCreate(Bundle savedInstanceState) { final Runtime runtime = Runtime.getRuntime(); try {

getApplicationContext() error Android

匿名 (未验证) 提交于 2019-12-03 01:19:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a fragment that allows a user to enter in a message and a phone number to which the message will be delivered. I am getting an error "cannot resolve method getApplicationContext()" I have looked at the answer here the method getApplicationContext() is undefined but it didn't help me, maybe I am implementing it wrong but I am not sure! This code works fine as an activity but not as a fragment. FragmentTab1 class package com . androidbegin . absfragtabhost ; import android . content . Context ; import android . os . Bundle ;

Attempted to finish an input event but input event receiver has already been disposed

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a custom adapter for my listview. The adapter contains a textview and a image button. I have implemented a popup menu on clicking the image button. Everything is working fine. But when selecting the options from popup menu, logcat displaying a single line message "Attempted to finish an input event but input event receiver has already been disposed" and nothing is happening. public class MyAdapter extends ArrayAdapter { public MyAdapter(Context context, int resourceId) { super(context, resourceId); } public MyAdapter(Context context,

How to hide toast“ Your audio will be sent to google to provide speech recognition service.” in Speech Recognizer?

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using google speech recognizer for integrating voice services in Android but while pressing on mic buttong this annoying toast message is showing.please suggest me a way to hide this. Thanks 回答1: If your device is rooted you can hide the notification, but not prevent the audio from being sent to Google. Install Xposed framework and module UnToaster Xposed, then add: com.google.android.googlequicksearchbox 回答2: So what you can do is to customize your speech recognizer by building it by your own. I wrote this code on xamarin.android so it

Android O - fingerprint gesture callback not working

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am testing on Pixel device with Fingerprint Gestures ON from accessibility. I am trying to get the gesture callbacks using FingerprintGestureController but never getting any gestures in return even after I turn the accessibility ON for this app from Settings->Accessibility. isGestureDetectionAvailable() is always returning false to me. Can someone please help. Here is the code: my_gesture_service.xml <accessibility-service xmlns:android="http://schemas.android.com/apk/res/android" android:accessibilityFeedbackType="feedbackGeneric" android

Problems To Cancel A CountDownTimer Android Java

匿名 (未验证) 提交于 2019-12-03 01:14:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When I close my app by pressing the BACK button (onBackPressed() called), the CountDownTimer doesn't stop, until it is done with counting. How can I put the CountDownTimer cancel(); in my onBackPressed() ? Because, when I quit my application (shown below with descriptions) I don't want counter toasts on my screen anymore. On top of my code: boolean network_connected = false; What's in my onCreate() : if (check_network.isInternetAvailable(this)) { network_connected = true; new connect_task_main().execute(""); } else { network_connected =

java.lang.RuntimeException: Handler (android.os.Handler) sending message to a Handler on a dead thread

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: in my app I'm using IntentService for sending SMS. @Override protected void onHandleIntent(Intent intent) { Bundle data = intent.getExtras(); String[] recipients = null; String message = getString(R.string.unknown_event); String name = getString(R.string.app_name); if (data != null && data.containsKey(Constants.Services.RECIPIENTS)) { recipients = data.getStringArray(Constants.Services.RECIPIENTS); name = data.getString(Constants.Services.NAME); message = data.getString(Constants.Services.MESSAGE); for (int i = 0; i when running the app, I