regarding popup

by kamcad » Sat, 14 Mar 2009 02:11:08 GMT


Sponsored Links
 how to implement popup after selecting a text? is there any
selectListener or something??

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Android: how to draw an ImageView with the same size regardless of device?

I want to put a toolbar in my application. The toolbar will use
ImageViews as application buttons. I would like the ImageViews to be
the exact same size regardless device; by "same size" I mean that,
when rendered to the screen, if I measure them with a ruler, the
dimensions will be the same. I would like this size to be ~10mm (the
width of my index finger).

I have been completely unsuccessful in accomplishing this.

I am testing on a MDPI, large screen Acer Iconia Tab and a HDPI medium
screen Samsung Galaxy Tab. If I set layout_width="50dip" and
layout_height="50dip", the buttons render as ~10mm on the Samsung, and
~8mm on the Acer. If I set the buttons as layout_width="12mm" and
layout_height="12mm", they render as 12mm on the Acer and ~9mm on the
Galaxy (confusing that 50dip renders bigger on the Galaxy than the
Acer, but 12 mm renders smaller on the Galaxy than on the Acer).

If I place a 32pix x 32pix icon in my drawable-mdpi folder (and no
equivalent in the drawable-hdpi folder), and set
layout_width="wrap_content" and layout_height="wrap_content"; the
results are similar to if set to 50dip, the Samsung is about 10mm, the
Acer about 8mm. If I add a 48pix x 48pix icon to my drawable-hdpi
folder, there is no change; presumably because the Acer still uses the
mdpi icon and the Samsung uses the bigger one, but scales it down by
50% because it knows its hdpi (if am confident that this surprising
scaling occurs because if I move the 48pix icon to the mdpi folder,
and have nothing in the hdpi folder, the icon shows very large on the
Samsung).

I then attempted to calculate the number of pixels necessary for 10mm
based on the values of xdpi and ydpi from DisplayMetrics: 10 mm in
pixels = xdpi * 10 / 25.4.  On the galaxy, this is  168.89 * 10 / 25.4
= 66.  However, when I set the layout_width to 66, the button measured
~8mm wide.  But, at 168.89 dpi, the dots per mm should be 6.64
(168.89/25.4), so 66pixels should be approximately 10mm.  So, how
could it measure 8mm?  The Galaxy must be scaling down the layout
parameters somehow. Is there any way to retrieve how much they are
scaling down by, so that I can adjust for it?

I am confused and could really use advice. How do I make my button
fingertip sized regardless of dpi and screen size?

-- 

2. help with TextView

I've finally gotten my first Android app to run without any errors,
however the TextView that I am using, is not being updated.

Here is the code and the last line is where I use setText to update my
textview.

If someone has any ideas as to why my TextView is not updating, could
you please help me out?

Thanks!

public class HelloAndroid extends Activity {
    /** Called when the activity is first created. */
        TextView tvIntro;
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);

        //setup text views
        this.setContentView(R.layout.main);

         tvIntro = (TextView)findViewById(R.id.tvIntro);


        //display game intro
        tvIntro.setText("Text Adventure - By T");

-- 

3. On CRC32, LVL and tamper-proof app

4. How to use Notification service from Broadcast receiver

5. How does one detect when an animation has finished?

6. Using transparent png textures won't work

7. Widget size problem