android-4.2-jelly-bean

Why toast message are not show in android 4.1 operating system containing mobile

人盡茶涼 提交于 2019-12-19 05:56:14
问题 I cant see the toast message in android 4.1 mobile. Upto yesterday I was able to see the toast message. From today only I can not see the message. Please help me. Toast.makeText(getApplicationContext(), "hi", Toast.LENGTH_SHORT).show(); I have tried custom toast message also instead of toast message. But still not working. Custom toast: LayoutInflater inflater=getLayoutInflater(); View layout = inflater.inflate(R.layout.toast_layout,(ViewGroup) findViewById(R.id.toast_layout_root)); TextView

Gson 2.2.2 causing a stackoverflow on 4.2.1 only

柔情痞子 提交于 2019-12-18 22:18:19
问题 I am developing an app for android which downloads points of interest from a server using JSON strings. Everything was working fine but since I have started testing on 4.2.1, I have been getting the following error: 01-28 15:32:14.167: E/AndroidRuntime(31174): FATAL EXCEPTION: AsyncTask #1 01-28 15:32:14.167: E/AndroidRuntime(31174): java.lang.RuntimeException: An error occured while executing doInBackground() 01-28 15:32:14.167: E/AndroidRuntime(31174): at android.os.AsyncTask$3.done

Android: Android 4.1 Emulator Invoking onDateSet Twice from DatePicker Dialog

最后都变了- 提交于 2019-12-18 14:14:38
问题 My application was working perfectly on my Android 2.2 emulator. I then decided to test on an Android 4.1 emulator. The DatePickerDialog looks a little different and for some reason when I press on "Done", the onDateSet() listener gets called twice and causes problems in my application. I know this because the log shown below in the code is printed twice whenever I click on "Done" mDateSetListener = new DatePickerDialog.OnDateSetListener() { @Override public void onDateSet(DatePicker view,

Unable to show keyboard automatically in the SearchView

半城伤御伤魂 提交于 2019-12-18 03:10:12
问题 The SearchView is focused by default, but when I try to show software keyboard - it doesn't happen: InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0); But when I click on the SearchView - it does. Why? 回答1: Fixed! mSearchView.setOnQueryTextFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View view, boolean hasFocus) { if (hasFocus) { showInputMethod(view

copy directory from assets to data folder

a 夏天 提交于 2019-12-18 02:49:27
问题 I would like to copy a quite big directory from the assets folder of my app to the data folder on the first run of the app. How do I do that? I already tried some examples, but nothing worked, so I don't have anything. My target is Android 4.2. Thanks, Yannik 回答1: try this code of your Application instance (you should write the class in manifest): This code is copying content of assets/files folder to the cache folder of app (you can place other path in copyAssetFolder() function). Only when

Logcat won't display Log.d messages

一曲冷凌霜 提交于 2019-12-18 02:27:14
问题 I'm developing an Android application and I would like to have some way to print debug statements as my code runs. Fortunately for me, Logcat was able to print out Log.d messages when I run my application on an Android 2.3.3 (API 10) emulator. However, when I tested the same exact application on a physical device (Samsung Galaxy S4 Android 4.2.2) I was unable to see anything other than dalvikvm and AndroidRuntime messages. com.android.internal.os.RuntimeInit <<<<<< 07-28 04:49:24.165: DEBUG

Camera Force Closing issue in Samsung Galaxy S3 version 4.1.1

烂漫一生 提交于 2019-12-18 01:06:08
问题 I want to capture image and save it in Image view in one of My Application. I already have an idea how to implement it and also Works fine in all device Except Samsung Galaxy S3. What I Want: Avoid the Force Closing Issue Coming in Samsung Galaxy S3 and probably for all other Device which i have not yet tested. What I have Done: I have Done the Below Code to achieve my goal. BuildInukshk_4 Activity : package com.inukshk.CreateInukshk; import java.util.Calendar; import android.app.Activity;

Use offline voice-to-text in Android 4.1 (Jelly Bean) from my application?

戏子无情 提交于 2019-12-17 15:42:43
问题 Android 4.1 includes offline voice typing. You can see this when you click the microphone on the pop-up keyboard, it still works if you have no network connection. However, it looks like the RecognizerIntent API still ends up requiring a network connection when you want to do speech recognition from your app. Is there an API for accessing new the offline voice typing feature in Android from my app? 回答1: Android uses two different APIs for voice: voice typing (key on the keyboard) and voice

null keyevent and actionid = 0 in onEditorAction() (Jelly Bean / Nexus 7)

一世执手 提交于 2019-12-17 11:27:30
问题 I have an edit text which functions as a search box in my application. In Jelly Bean on my Nexus 7 when I type something into the text box which I am listening on and hit enter the KeyEvent = null and ActionId = 0 passed into the onEditorAction() method. Has anyone else encountered this? I'm thinking it might be a bug. In the second if statement below I get a null pointer because the actionId = 0 and KeyEvent = null; // Search field logic. @Override public boolean onEditorAction(TextView v,

Create custom lockscreen for android 4.0 or above?

拜拜、爱过 提交于 2019-12-17 10:15:00
问题 I want to create custom lockScreen for android 4.0 and above, I have tried widget to create lockscreen but it supports only android 4.2. Is there any other way to create custom android lockScreen? 回答1: I have found snippets somewhere on internet few months ago, I have made changes and recently uploaded the working demo on my github account, You can have a look at this Note: It will disable "hardware" home button. I hope it will be helpfull !! Screenshots: It provides lockscreen in API 8 or