2013-10-17 2 views
0

현재 10 인치 태블릿에서 Android 휴대 전화를 지원하는 코드를 실행 해 보았습니다. 그러나 응용 프로그램은 "현재이 장치에서 지원되지 않는 응용 프로그램"오류를 표시합니다. 어떻게 작동시킬 수 있는지 궁금합니다. 나는 android : xlargescreen = "false">를 변경하려고 시도했지만 사실로 수정하지는 못했다. 여기 같은 내 안드로이드 매니페스트 코드입니다 : 장치가 지원되지 않는 경우 내가 경고를 호출하고 내 시작 활동에, 또한아무런 문제없이 휴대 전화에서 태블릿 화면으로 전환하는 방법

<supports-screens 
     android:anyDensity="true" 
     android:resizeable="false" 
     android:smallScreens="true" 
     android:normalScreens="true" 
     android:largeScreens="true" 
     android:xlargeScreens="true" 

     /> 

    <uses-sdk 
     android:minSdkVersion="10" 
     android:targetSdkVersion="18" /> 

입니다 : 내가 얻을 수있는 방법

/** 
    * This method was originally used to detect if the device is supported or not 
    * The device detection has been moved to the Android Manifest XML file 
    * supports-screens tag 
    * @return boolean true if device is supported 
    */ 
    private boolean isDeviceSupported() { 
     if (!Application.getAppResources().getBoolean(R.bool.isDeviceSupported)) { 
      AlertDialog.Builder builder = new AlertDialog.Builder(this); 
      builder.setMessage(getResources().getString(R.string.device_not_supported)).setCancelable(false).setPositiveButton("Ok", new DialogInterface.OnClickListener() { 
       public void onClick(DialogInterface dialog, int id) { 
        finish(); 
       } 
      }); 
      AlertDialog alert = builder.create(); 
      alert.show(); 
      return false; 
     } else { 
      return true; 
     } 
    } 


private void goToLoginActivity() { 
     //Device detection has been moved to Android manifest XML file 
     if (isDeviceSupported()) { 
      LoginActivity.newInstance(this); 
      finish(); 
     } 
    } 

모든 단서 내 10 인치 안드로이드 타블렛에서 작동합니까?

감사합니다. 같은 AndroidManifest.xml을에 사용-권한과 기능에 거짓 필요한

+0

태블릿에서 전화와 같이 사용할 수없는 권한이 있습니까? – tyczj

+0

이들은 내 권한입니다 :

답변

0

설정 :

<uses-permission 
     android:name="android.permission.CAMERA" 
     android:required="false"/> 

    <uses-feature 
     android:name="android.hardware.camera" 
     android:required="false"/> 

    <uses-feature 
     android:name="android.hardware.camera.autofocus" 
     android:required="false"/> 

편집 :

또한

android:resizeable="false" 

되지 않습니다 (http://developer.android.com/guide/topics/manifest/supports-screens-element.html#resizeable)를 제거하려고 , 모든 블록 지원 화면을 제거 할 수 있습니다. 왜냐하면 def ault 값은 참입니다.

+0

아직 작동하지 않는다면 스플래시 화면에서 지원되지 않는 장치의 경고 메시지가 표시됩니다. 누락 된 내용이 있습니까? 응용 프로그램을 시작할 때 스플래시 화면에 –

+0

? 프로그램 가능한 결함이라고 생각합니다. R.bool.isDeviceSupported 값을 보여주십시오. – artemiygrn

관련 문제