gsfd
gsfd

Reputation: 1070

Drawing a drawable on a tablet

I have an Activity running on a tablet. I have a background drawn onto the tablet like so:

public DrawingView(Context context, int screen_width, int screen_height)
{
    board = context.getResources().getDrawable(R.drawable.background); 
}

...

public void onDraw(Canvas canvas)
{
    background.draw(canvas);
}

private Drawable background;

When i run this, the background is drawn under the bar at the bottom that has the back button and the keyboard button on it. The image is cut off a little bit. Is there a way to hide this bar? I am running my activity on the Xoom. Is there a way to find out if the activity is being run on a tablet? anybody have any work around ideas?

Upvotes: 1

Views: 125

Answers (1)

MrJre
MrJre

Reputation: 7161

Short answer: no, you can't hide the bottom bar, only dim it.

If you want to check if your activity running on a tablet, check for XLARGE screen size like so:

if(context.getResources().getConfiguration().screenLayout == Configuration.SCREENLAYOUT_SIZE_XLARGE){}

or check for android version (atm everything above 10 is honeycomb and thus tablet) like so: if(android.os.Build.VERSION.SDK_INT > 10) { ... }

Upvotes: 1

Related Questions