Category Archives: Android Examples Code

2,345 views

Histogram foto picture smartphone

Very dark picture, in photo editor black remains black Very bright picture, in photo editor white will white Dark picture but the chart is not in black color area – dark shades can be lighten in graphics editor

Posted in Android Examples Code, Smartphones | Comments Off on Histogram foto picture smartphone
4,298 views

Android 4.4 Lenovo A6000 black screen

Try reboot device. Start device with start button on side of phone. Screen will go to light black color. Long press Start button for menu: Power off Reboot Airplane mode Reboot item is in same level like Start button. Click … Continue reading

Posted in Android Examples Code, Bugs, warnings, errors | Tagged , | Comments Off on Android 4.4 Lenovo A6000 black screen
4,579 views

Android runtime change switch Activity theme

static boolean mbThemeLight = false;   @Override public void onCreate(Bundle savedInstanceState) { if(mbThemeLight) setTheme(android.R.style.Theme_Light); super.onCreate(savedInstanceState); // bla bla bla………. }   private void switchTheme(){ mbThemeLight = true; this.recreate(); }

Posted in Android Examples Code, Android Studio | Tagged | Comments Off on Android runtime change switch Activity theme
4,678 views

Expected resource of type raw drawable

Try insert + before R.drawable.xxxx // error InputStream is = context.getResources().openRawResource(R.drawable.app_sample_code);   // ok InputStream is = context.getResources().openRawResource(+R.drawable.app_sample_code);

Posted in Android Examples Code, Bitmap, drawing, Bugs, warnings, errors | Comments Off on Expected resource of type raw drawable
5,920 views

Call requires permission which may be rejected by user

Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with `checkPermission`) or explicitly handle a potential `SecurityException`   try { // your code for example: // LocationManager locationManager = (LocationManager) … Continue reading

Posted in Android Examples Code, Bugs, warnings, errors | Tagged | Comments Off on Call requires permission which may be rejected by user
5,190 views

EditText.setOnKeyListener not working on maxLines EditText

Check this in XML file if use singleLine singleLine change to maxLines (1 if singleLine) declare inputType android:maxLines="1" android:inputType="text"

Posted in Android Examples Code, Bugs, warnings, errors | Tagged , , | Comments Off on EditText.setOnKeyListener not working on maxLines EditText
5,194 views

ArrayList Sublist Join Compare Loop Synchronize HashMap Sort Tree

Link to tutorial ArrayList Sublist of ArrayList Join two ArrayList Compare ArrayList Initialize ArrayList Loop ArrayList Sort ArrayList Array to ArrayList ArrayList to Array Synchronize ArrayList Serialize ArrayList LinkedList Loop LinkedList Vector ArrayList vs Vector ArrayList vs LinkedList HashMap Loop … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on ArrayList Sublist Join Compare Loop Synchronize HashMap Sort Tree
5,244 views

EditText hint not show

Try this solution – into xml file add row to EditText tag: android:textColorHint="@color/grey"

Posted in Android Examples Code, Bugs, warnings, errors | Tagged , , | Comments Off on EditText hint not show
5,651 views

Convert Activity to Fragment Step by Step

public class Main extends Activity {   private TextView mTextView; private Activity mAct; private Intent mIntent;   protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_layout); mTextView = findViewById(R.id.mTextView); mAct = getActivity(); mIntent = getIntent(); }   } to: public class Main … Continue reading

Posted in Android Examples Code, Fragments Tutorial | Tagged | Comments Off on Convert Activity to Fragment Step by Step
5,111 views

Android Fragment Examples

Code look up at the Api Demos android_fragments arguments attributes – three fragments on screen android_fragments_alert_dialog android_fragments_context_menu android_fragments_custom_animation android_fragments_dialog android_fragments_dialog_or_activity fragment_hide_show fragment_layout fragments_list_array fragment_menu android_fragments_get_result_from_fragment and tabs in two rows android_fragments_recive_result android_fragments_stack fragment_tabs

Posted in Android Examples Code, Android Studio, Fragments Tutorial | Tagged , | Comments Off on Android Fragment Examples