Trackball button highlighting?

by Sundog » Fri, 31 Oct 2008 00:34:15 GMT


Sponsored Links
 Hello all, I'm the author of Nitoware Mahjongg Solitaire. The game
uses many small ImageButtons, and I expected the trackball to "just
work" as an alternative to touching them, but although it SEEMS to be
working, the user can't see any feedback that lets them know where the
trackball is so they can use it.

Does anyone know a way around this?

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



Trackball button highlighting?

by zl25drexel » Fri, 31 Oct 2008 04:54:48 GMT


 You are looking for onFocused(), I believe there's a onFocuseListener
you can set.



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


Sponsored Links


Trackball button highlighting?

by Sundog » Fri, 31 Oct 2008 23:23:39 GMT


 Thank you very much. I should have seen that myself.





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



Other Threads

1. unable to get current location on map

I am trying to get my current location on my xperia X10i phone. There
is no error in application code but i am not getting the location. I
have tried to use built in navigation. It works fine but i have to
turn on GPS satellite receiver as well wifi network. Here is my
application code.

import android.app.Activity;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class LbsGeocodingActivity extends Activity {

    private static final long MINIMUM_DISTANCE_CHANGE_FOR_UPDATES = 1;
// in Meters
    private static final long MINIMUM_TIME_BETWEEN_UPDATES = 1000; //
in Milliseconds
    protected LocationManager locationManager;
    protected Button retrieveLocationButton;

    @Override
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        retrieveLocationButton = (Button)
findViewById(R.id.retrieve_location_button);
        locationManager = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
        locationManager.requestLocationUpdates(
                LocationManager.GPS_PROVIDER,
                MINIMUM_TIME_BETWEEN_UPDATES,
                MINIMUM_DISTANCE_CHANGE_FOR_UPDATES,
                new MyLocationListener()
        );

    retrieveLocationButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                showCurrentLocation();
            }
    });

    }

    protected void showCurrentLocation() {

        Location location =
locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);

        if (location != null) {
            String message = String.format(
                    "Current Location \n Longitude: %1$s \n Latitude: %2$s",
                    location.getLongitude(), location.getLatitude()
            );
            Toast.makeText(LbsGeocodingActivity.this, message,
                    Toast.LENGTH_LONG).show();
        }

    }

    private class MyLocationListener implements LocationListener {

        public void onLocationChanged(Location location) {
            String message = String.format(
                    "New Location \n Longitude: %1$s \n Latitude: %2$s",
                    location.getLongitude(), location.getLatitude()
            );
            Toast.makeText(LbsGeocodingActivity.this, message,
Toast.LENGTH_LONG).show();
        }

        public void onStatusChanged(String s, int i, Bundle b) {
            Toast.makeText(LbsGeocodingActivity.this, "Provider status changed",
                    Toast.LENGTH_LONG).show();
        }

        public void onProviderDisabled(String s) {
            Toast.makeText(LbsGeocodingActivity.this,
                    "Provider disabled by the user. GPS turned off",
                    Toast.LENGTH_LONG).show();
        }

        public void onProviderEnabled(String s) {
            Toast.makeText(LbsGeocodingActivity.this,
                    "Provider enabled by the user. GPS turned on",
                    Toast.LENGTH_LONG).show();
        }

    }

}

any suggestion ??

BR,
Zeeshan

-- 

2. On Android 2.2, is it possible to make the web browser switch to full-screen mode by using javascript?

Also is it possible to use javascript to block forward and backward of
web browser?

-- 

3. How to prevent saving browser pages in activity stack history

4. Cannot receive UDP packets in Android 2.2

5. Updating Market Apps

6. GPS and Network Position!

7. Estimation go across to GeoPoint !