How to start an activity depending on screen size? So, I check in my main_activity class if my screen size is mdpi or hdpi and depending on that I need to start appropriate method within my game activity. I have two tables in my database with mdpi and hdpi images. But I get nothing. Only my blank main activity. What's the problem? Here's my main activity:
public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Display display = getWindowManager().getDefaultDisplay(); 
int width = display.getWidth();
int height = display.getHeight();

if((width>320) && (width<480)){
Intent i = new Intent(MainActivity.this, GameDanska.class);
i.putExtra("myMethod", "nextQuestionMDPI");
startActivity(i);

}
else if((width>480) && (width<720)){
Intent i2 = new Intent(MainActivity.this, GameDanska.class);
i2.putExtra("myMethod", "nextQuestionHDPI");
startActivity(i2);
}

    }


seems like this can do the trick, you can use the Configuration.screenLayout bitmask.
Example:
if ((getResources().getConfiguration().screenLayout & 
    Configuration.SCREENLAYOUT_SIZE_MASK) == 
Configuration.SCREENLAYOUT_SIZE_LARGE) {
    // on a large screen device ...

}


Use a switch as follows
Intent i = new Intent(this, GameDanska.class);

switch (getResources().getDisplayMetrics().densityDpi) {
    case DisplayMetrics.DENSITY_MEDIUM:
i.putExtra("myMethod", "nextQuestionMDPI");
startActivity(i);
break;
    default:
i.putExtra("myMethod", "nextQuestionHDPI");
startActivity(i);
break;
}

If your app is only abailable for MDPI, HDPI, XHDPI remember to put the screen compabilities on you manifest.xml file.   
<compatible-screens>
    <screen android:screenSize=["small" | "normal" | "large" | "xlarge"]
android:screenDensity=["ldpi" | "mdpi" | "hdpi" | "xhdpi"] />
    ...
</compatible-screens>

In your case
 <compatible-screens>
    <screen android:screenSize="small" android:screenDensity="mdpi"/>
    <screen android:screenSize="small" android:screenDensity="hdpi"/>
    <screen android:screenSize="small" android:screenDensity="xhdpi"/>

    <screen android:screenSize="normal" android:screenDensity="mdpi"/>
    <screen android:screenSize="normal" android:screenDensity="hdpi"/>
    <screen android:screenSize="normal" android:screenDensity="xhdpi"/>

    <screen android:screenSize="large" android:screenDensity="mdpi"/>
    <screen android:screenSize="large" android:screenDensity="hdpi"/>
    <screen android:screenSize="large" android:screenDensity="xhdpi"/>

    <screen android:screenSize="xlarge" android:screenDensity="mdpi"/>
    <screen android:screenSize="xlarge" android:screenDensity="hdpi"/>
    <screen android:screenSize="xlarge" android:screenDensity="xhdpi"/>
 </compatible-screens>

API Screen reference
Switch reference

instead of it you can directly put your images inside res->mdpi,hdpi,xhdpi,ldpi folder
for ldpi 320dp: a typical phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc)
for mdpi 480dp: a tweener tablet like the Streak (480x800 mdpi). 
for hdpi 600dp: a 7” tablet (600x1024 mdpi). 
for xhdpi 720dp: a 10” tablet (720x1280 mdpi, 800x1280 mdpi, etc).