2014-09-16 4 views
0

내 앱에 알림을 추가하려고합니다. 아래의 코드를 시도했지만 문제는 아래 코드를 사용하면 표시되는 부분 텍스트 만 볼 수 있다는 것입니다. 즉, "가져온 Android 프로젝트 가져 오기" 나머지 텍스트는 잘립니다. 알림 표시 문제

enter image description here

NotificationCompat.Builder mBuilder = 
       new NotificationCompat.Builder(this) 
         .setSmallIcon(R.drawable.ic_launcher) 
         .setContentText("Import the unzipped Android project into Eclipse by selecting File") 
         .setContentTitle(getApplicationContext().getString(R.string.app_name)) 
         .setContentIntent(notifyIntent); 

그래서 나는 BigTextStyle을 시도하지만 지금은 표시 아무것도 없다. 아래 코드 :

NotificationCompat.Builder mBuilder = 
       new NotificationCompat.Builder(this) 
         .setSmallIcon(R.drawable.ic_launcher) 
         .setContentTitle(getApplicationContext().getString(R.string.app_name)) 
         .setContentIntent(notifyIntent); 

     NotificationCompat.BigTextStyle textStyle = new NotificationCompat.BigTextStyle(); 
     textStyle.bigText("Import the unzipped Android project into Eclipse by selecting File"); 
     mBuilder.setStyle(textStyle); 
     NotificationManager mNotifyMgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); 
     mNotifyMgr.notify(mNotificationId, mBuilder.build()); 

표적으로 API가 15 ~ 20이고 응용 프로그램이 API에 테스트되고 15

+0

스크린 샷을 게시 할 수 있습니까? –

+0

Screenshot attached – Psypher

답변

0

불행하게도, API 16 이상, 그래서의 compat 라이브러리 지내다의 15에이 일에 setBigText 작품 하위

http://developer.android.com/reference/android/app/Notification.BigTextStyle.html#bigText(java.lang.CharSequence)

+0

API 16 이상에서는 BigText를 사용할 수 있습니다. API 15에 대해서는 전체 텍스트를 어떻게 표시 할 수 있습니까? – Psypher

+0

장치가 없으면 api 16 이상으로 설정된 에뮬레이터를 사용하십시오. http://www.genymotion.com/은 안드로이드 SDK에 제공된 에뮬레이터뿐만 아니라 꽤 괜찮습니다. http://developer.android.com/tools/devices/emulator.html – petey

+0

하지만 어떻게하면 API로 작동시킬 수 있습니까? 15 개 장치? – Psypher