1
2
3
4
5
6
7
8
9
10
|
boolean isTablet () {
int portrait_width_pixel=Math.min(this.getResources().getDisplayMetrics().widthPixels, this.getResources().getDisplayMetrics().heightPixels);
int dots_per_virtual_inch=this.getResources().getDisplayMetrics().densityDpi;
float virutal_width_inch=portrait_width_pixel/dots_per_virtual_inch;
if (virutal_width_inch <= 2) {
return false;
} else {
return true;
}
}
|
[호출될 앱] 다른 앱이나 웹에서 호출될 앱의 AndroidManifest.xml 파일을 열어 원하는 activity에 아래와 같이 빨간 부분을 추가 한다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 <activity android:name= ".testUrlScheme" android:label= "@string/app_name" > <intent-filter> <action android:name= "android.intent.action.MAIN" /> <category android:name= "android.intent.category.LAUNCHER" /> </intent-filter> ...
댓글
댓글 쓰기