Tag Archives: toast

8,335 views

Memory usage of application in Android sample code

public class MainClass extends Activity { ActivityManager activityManager; MemoryInfo memoryInfo; final String TAG = "MemInfo";     @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);   activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE); memoryInfo = new ActivityManager.MemoryInfo();   activityManager.getMemoryInfo(memoryInfo);   Log.i(TAG, " memoryInfo.availMem … Continue reading

Posted in Android Examples Code | Tagged , , | Comments Off on Memory usage of application in Android sample code
69,080 views

Spinner ComboBox DropDown List Android example code

Spinner in Android application is equivalent of ComboBox in WinApi. Spinner get selected item to string example. Spinner get selected item position to int example. Main activity class MainComboBox.java public class MainComboBox extends Activity { @Override public void onCreate(Bundle savedInstanceState) … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on Spinner ComboBox DropDown List Android example code
4,453 views

Alert messagebox toast Android example code

Toast in Android application is equivalent of Alert in JavaScript or MessageBox in WinApi. // Toast android.widget.Toast.makeText(Context context, CharSequence text, int duration) // public static Toast makeText (Context context, CharSequence text, int duration)   Toast.makeText(getApplicationContext(), "Hello world!", Toast.LENGTH_SHORT).show();

Posted in Android Examples Code | Tagged , , , | Comments Off on Alert messagebox toast Android example code