How to get the highest API level supported by the device?

by Dianne Hackborn » Sat, 28 Nov 2009 08:12:57 GMT


Sponsored Links
 It's only deprecated because it's better to use SDK_INT if your
minSdkVersion is >= 4.







> > >



How to get the highest API level supported by the device?

by Dianne Hackborn » Sun, 29 Nov 2009 02:46:49 GMT


 No it will not.









> > > > >


Sponsored Links


Other Threads

1. getScale() method of BaseAdapter class Question!

Hello,

I implement a class inheriting the BaseAdapter to provide data for a
Gallery. There is a method in the BaseAdapter class that I have to
implement is getScale(boolean focused, int offset)

This method is used to scale images which are on left and right hand
side of the center image. I tried to write logs to know the order in
which getView, getScale, onDraw(of gallery), onDraw(of ImageView)
methods are called. I wonder how the getScale method would be called.
What I mean is when this method will be called and by which method,
which event of gallery object.

I want to know this because I want to do something else when images
are scaled (when getScale() method is called). Which method should I
override to control this?

Thanks,

Colin
--~--~---------~--~----~------------~-------~--~----~

2. Error recieving broadcast null in LocationIntentReciever

Would someone post code that successfully removes updates and
unregisters receivers without ever getting the broadcast null crash?

I have tried every imaginable combination of changes, including a
boolean on variable, but with a few runs of the app, it still
eventually gives this crash after I close, even when wiping data on
the emulator.

Here's my current relevant code:


    private LocationManager locationManager;
    private LocationIntentReceiver intentReceiver = new
LocationIntentReceiver();
    private static final String LOCATION_CHANGED_ACTION = new
String("android.intent.action.LOCATION_CHANGED");
    private IntentFilter intentFilter = new
IntentFilter(LOCATION_CHANGED_ACTION);
    private Intent intent = new Intent(LOCATION_CHANGED_ACTION);

    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.main);

        locationManager =
(LocationManager)this.getSystemService(Context.LOCATION_SERVICE);
        registerReceiver(intentReceiver, intentFilter);
    }

    public class LocationIntentReceiver extends IntentReceiver{
        @Override
        public void onReceiveIntent(Context context, Intent intent) {
                if (startLocation == null)
                        return;

                        //Location currentLocation = 
(Location)intent.getExtra("location");
                        Location currentLocation =
locationManager.getCurrentLocation("gps");

                                                ...
                                           }
    }


    @Override
    public void onResume() {
        super.onResume();
                List<LocationProvider> providers = 
locationManager.getProviders();
                LocationProvider locationProvider = providers.get(0);
                locationManager.requestUpdates(locationProvider, 0, 0, intent);
    }

    @Override
    public void onFreeze(Bundle icicle) {
        locationManager.removeUpdates(intent);
        super.onFreeze(icicle);
    }

    @Override
    public void onDestroy() {
        unregisterReceiver(intentReceiver);
        super.onDestroy();
    }

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

3. SearchManager / Searchability API feedback (M5)

4. dx result is not always the same?

5. Proxy.getInvocationHandler(...) returns null

6. HELP! Weird Activity lifecycle / thread issue

7. Dialog generating NullPointerException