Pages

Tuesday, July 3, 2012

Android : CharacterPickerDialog Example



main.xml:
<?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"
    android:orientation="vertical" >

        <Button
        android:id="@+id/Button01"
        android:layout_gravity="center"
        android:layout_marginTop="40dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="CharacterPickerDialog" />

</LinearLayout>




CharacterPickerDialogActivity.java:
public class CharacterPickerDialogActivity extends Activity {
    /** Called when the activity is first created. */
 private CharacterPickerDialog cpd = null;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Button button = (Button) this.findViewById(R.id.Button01);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                cpd.show();
            }
        });
          String options="0123456789ABCDEF";  
          cpd= new CharacterPickerDialog(this, new View(this), null,options,false){ 
           public void onClick(View v) {
                     
                     Toast.makeText(getApplicationContext(),
                             "onClick! " + ((Button) v).getText().toString(),
                             Toast.LENGTH_SHORT).show();
                     dismiss();
            }
           public void onItemClick(AdapterView parent, View view, int position, long id)
                 {
                     
                     String message = ("onItemClick! " + ((Button) view).getText().toString())
                             + " position=" +
                             position
                             + " id=" + id;
                     Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();
                     dismiss();
                 }
      };
    }
}


Download Source Code: CharacterPickerDialogExample








8 comments:

  1. इमरान बोले- मैं सिखाऊंगा मोदी को कैसे जवाब देना है
    Read More TodayNews18.com https://goo.gl/oumDQX

    ReplyDelete
  2. 24K Monkey Classic Incense 10g
    AK-47 – X10 / PREMIUM
    Bizarro Incense
    Buy Black Mamba Incense Online
    Buy WTF Herbal Incense
    Cloud9 Mad Hatter Incense
    Crazy Monkey Incense
    k2 spray on paper
    k2 paper sheets
    Klimax Potpourri 15xxx Coconut(10g)
    Crazy Monkey Incense
    Cloud9 Mad Hatter Incense
    Buy Purple Diesel Incense Online
    Buy Pure Fire Herbal Incense Online
    Buy Kisha Cole Incense (11g) online
    Buy KUSH HERBAL INCENSE online
    Buy Mind Trip Incense Online
    Buy Platinum XXX Herbal Incense online
    buy Orange Platinum Caution 10G
    Buy OMG HERBAL POTPOURRI 10G online

    ReplyDelete
  3. https://k2incenseonlineheadshop.com/
    k2incenseonlineheadshop
    info@k2incenseonlineheadshop.com
    Buy liquid incense cheap
    Buy liquid incense cheap For Sale At The Best Incense Online Shop
    K2 Spice Spray | Liquid K2 | Liquid Spice | K2 Spray for sale
    https://k2herbalblendshop.com/

    ReplyDelete
  4. https://bestmjstrainsonline.com/

    Buy Liquid Incense Cheap
    Buy K2 E-Liquid online
    Cheap Herbal incense

    Buy K2 Infused paper spray online, order K2 Spray online +1 (925) 526-5453

    https://bestmjstrainsonline.com/product/5-co2-cannabis-oil-cartridges/



    ReplyDelete
  5. Dispensary care is what many people lack in the interior areas of the world. Weed, can help you recover shortly. marijuana. people face a lot of health issues everyday without solution. Weed However, marijuana has always been a perfect remedy for ill health. Nevertheless, cocaine may also help.

    ReplyDelete