Search found 35 matches

Go to advanced search

by vivekkalady
Mon Nov 24, 2014 2:55 pm
Forum: Tutorials & Examples
Topic: Dynamically open one fragment from another fragment in Android
Replies: 0
Views: 1461

Dynamically open one fragment from another fragment in Android

Fragments are usually loaded into FrameLayout Your xml will be like this <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent...
by vivekkalady
Mon Nov 24, 2014 1:49 pm
Forum: Tutorials & Examples
Topic: Layout Inflator in Android
Replies: 0
Views: 676

Layout Inflator in Android

Layout-Inflater class is used to instantiate layout XML file into its corresponding View objects.In other words, it takes as input an XML file and builds the View objects from it. Let’s first take a look at how LayoutInflater works. There are two usable versions of the inflate() method for a standar...
by vivekkalady
Sun Nov 23, 2014 2:14 pm
Forum: Tutorials & Examples
Topic: Bitwise Operations in Android
Replies: 0
Views: 705

Bitwise Operations in Android

Bitwise operators are operators (just like +, *, &&, etc.) that operate on ints and uints at the binary level. This means they look directly at the binary digits or bits of an integer. ⋅ & (bitwise AND) ⋅ | (bitwise OR) ⋅ ~ (bitwise NOT) ⋅ ^ (bitw...
by vivekkalady
Sun Nov 23, 2014 10:20 am
Forum: Tutorials & Examples
Topic: Thread example with Handler in android
Replies: 0
Views: 629

Thread example with Handler in android

This is a simple example of thread The thread downloads the string from web and send it to the handler On response, the handler will show the string as a Toast. Thread background = new Thread(new Runnable() { private final HttpClient Client = new DefaultHttpClient(); private String URL = "http:...
by vivekkalady
Sun Nov 23, 2014 9:27 am
Forum: Tutorials & Examples
Topic: Disable, Hide Menu dynamically in android
Replies: 0
Views: 716

Disable, Hide Menu dynamically in android

This example shows how to Also Show/Hide a Menu. myMenu.findItem(R.id.menuopt1).setVisible(isChecked); Enable/Disable a Menu item. myMenu.findItem(R.id.menuopt1).setEnabled(isChecked); public class MainActivity extends Activity { ToggleButton btn1, btn2, btn3; Menu myMenu; @Override protected void o...
by vivekkalady
Sun Nov 23, 2014 9:08 am
Forum: Tutorials & Examples
Topic: Change Menu with Fragment in android
Replies: 0
Views: 1479

Change Menu with Fragment in android

This Post shows how to change Menu with each Fragment.We can show Common Menus like Settings,About,etc in Main Activity Menu and Fragment Menus in corresponding fragments Main Activity @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if...
by vivekkalady
Sat Nov 22, 2014 3:25 pm
Forum: Tutorials & Examples
Topic: Random Number with Limit in android
Replies: 0
Views: 583

Random Number with Limit in android

Random Number is generated using Random Class simple code block to show Random number int pos = rand.nextInt(100); this is the simple function which returns a random number The code below gives the random number between 20 and 90 int min = 20; int max = 90; Random r = new Random(); int i1 = r.nextI...
by vivekkalady
Sat Nov 22, 2014 3:05 pm
Forum: Tutorials & Examples
Topic: Append String in android using StringBuilder
Replies: 0
Views: 477

Append String in android using StringBuilder

StringBuilder is a mutable string, unlike regular strings which are immutable. StringBuilder is especially useful when you need to concatenate many strings StringBuilder sb = new StringBuilder(); sb.append("first String "); sb.append(intValue); sb.append(" string again"); sb.app...
by vivekkalady
Sat Nov 22, 2014 11:51 am
Forum: Tutorials & Examples
Topic: AsyncTask in android
Replies: 0
Views: 701

AsyncTask in android

AsyncTask has four steps: ⋅ doInBackground: Code performing long running operation goes in this method. When onClick method is executed on click of button, it calls execute method which accepts parameters and automatically calls doInBackground method with the parameters passed. ⋅ ...
by vivekkalady
Sat Nov 22, 2014 11:09 am
Forum: Tutorials & Examples
Topic: Bitmap operations in Android
Replies: 0
Views: 695

Bitmap operations in Android

Bitmap from Resource Creating bitmap from resource drawable - If we have image in drawable folder then we can easily create bitmap from it. Bitmap bmp= BitmapFactory.decodeResource(getResources(), R.drawable.img); img.setImageBitmap(bmp); Creating bitmap from a file stored in sdcard try{ Bitmap bit...

Go to advanced search

cron