after referring the group 锛宼ouch screen can only respond at top bar

by Bj枚rn Lustig » Tue, 02 Mar 2010 22:00:49 GMT


Sponsored Links
 You should capture the input event stream using "getevent". Paste your
getevent output for taps (just tap your finger on the screen), for long
presses (press your finger for a couple of seconds) and for slides (slide
your finger on the screen). You can compare the working getevent output from
a good device with the getevent output from your device. Post it here and
those kindly Google engineers may help you solve their problem.




> website: 



Other Threads

1. Programmatically setting the layout_above value

Hi Becca,

It's very simple, you can do something like the following:

LayoutParams layoutParams = new RelativeLayout.LayoutParams
(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
layoutParams.addRule(RelativeLayout.ABOVE, myView.getId());

Where myView is the view you want to be above. Make sure you call
setId to programmatically assign an id.

Extra tip: If you're using the layout params on a View that will be
instantiated frequently (like a ListView child), you can create a
single static instance of your LayoutParams (initialize it in a static
block), and reuse it for all items (for id's assign predefined
constants. They don't have to be globally unique)

Lior
UltimateFavesPRO developer.
http://ultimatefaves.wordpress.com




-- 

2. MediaStore returning loop of images and not entire directory

Hello, I'm testing some code from a demo found in a forum and I'm
getting some strange results.  My goal is to be able to allow users to
access the pictures on their device to choose an avatar/logo.  This
code run flawlessly except that I only get a handful of images on the
phone.  And its not even always the same images.  Whats more is that
it loads those images into a gridview and repeats them for what looks
like a number of times equal to the actual number of images that are
on the device.  And on top of that if I scroll down the through the
pictures, and scroll back up, it reorders the pictures from what they
were previously.  Each time I load the app the pictures seem to be
different as well.  I have around 400 pictures stored on my phone, and
thats what I'm using to test.  If someone could shed some light on
this for me that would be great.  This is my first time using a URI to
access content to I'm not sure where to start troubleshooting this
one.

public class gallery extends Activity {

    /**
     * Cursor used to access the results from querying for images on
the SD card.
     */
    private Cursor cursor;
    /*
     * Column index for the Thumbnails Image IDs.
     */
    private int columnIndex;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.gallery);

        // Set up an array of the Thumbnail Image ID column we want
        String[] projection = {MediaStore.Images.Thumbnails._ID};
        // Create the cursor pointing to the SDCard
        cursor = managedQuery
( MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,
                projection, // Which columns to return
                null,       // Return all rows
                null,
                MediaStore.Images.Thumbnails.IMAGE_ID);
        // Get the column index of the Thumbnails Image ID
        columnIndex = cursor.getColumnIndexOrThrow
(MediaStore.Images.Thumbnails._ID);

        GridView sdcardImages = (GridView) findViewById(R.id.sdcard);
        sdcardImages.setAdapter(new ImageAdapter(this));

        // Set up a click listener
        sdcardImages.setOnItemClickListener(new OnItemClickListener()
{
            public void onItemClick(AdapterView parent, View v, int
position, long id) {
                // Get the data location of the image
                String[] projection = {MediaStore.Images.Media.DATA};
                cursor = managedQuery
( MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
                        projection, // Which columns to return
                        null,       // Return all rows
                        null,
                        null);
                columnIndex = cursor.getColumnIndexOrThrow
(MediaStore.Images.Media.DATA);
                cursor.moveToPosition(position);
                // Get image filename
                String imagePath = cursor.getString(columnIndex);
                // Use this path to do further processing, i.e. full
screen display
            }
        });
    }

    /**
     * Adapter for our image files.
     */
    private class ImageAdapter extends BaseAdapter {

        private Context context;

        public ImageAdapter(Context localContext) {
            context = localContext;
        }

        public int getCount() {
            return cursor.getCount();
        }
        public Object getItem(int position) {
            return position;
        }
        public long getItemId(int position) {
            return position;
        }
        public View getView(int position, View convertView, ViewGroup
parent) {
            ImageView picturesView;
            if (convertView == null) {
                picturesView = new ImageView(context);
                // Move cursor to current position
                cursor.moveToPosition(position);
                // Get the current value for the requested column
                int imageID = cursor.getInt(columnIndex);
                // Set the content of the image based on the provided
URI
                picturesView.setImageURI(Uri.withAppendedPath(
 
MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, "" + imageID));
                picturesView.setScaleType
(ImageView.ScaleType.FIT_CENTER);
                picturesView.setPadding(8, 8, 8, 8);
                picturesView.setLayoutParams(new GridView.LayoutParams
(100, 100));
            }
            else {
                picturesView = (ImageView)convertView;
            }
            return picturesView;
        }
    }
}

-- 

3. Keeping an Activity alive instead of destroying it?

4. Tapping activity after startActivityForResult

5. Sending binary signals on the USB port

6. Programmatically setting the layout_above value

7. How to play two videos gapless using MediaPlayer.