context().getString(R.string.denial_msg)
.length();
Display display = ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE))
.getDefaultDisplay();
@SuppressWarnings("deprecation")
int textWidth = display.getWidth() / TextSize;
String[] events = new String[textWidth];// Sets a title for the Inbox style
for (int i = 0; i < textWidth; i++) {
if((float)(i+1)*textWidth > (float)(display.getWidth() / TextSize;
events[i] = context().getString(R.string.msg).substring(i*textWidth, (i+1)*textWidth);
else
events[i] = context().getString(R.string.msg).substring(i*textWidth);
inboxStyle.addLine(events[i]);
}
화면 크기에 맞게 텍스트 나누어서 뿌려주는 걸 만들어 봄. error군.
void notifykndroidlinaialNotification() {
Intent intent = new Intent("com.apple.app.linaial.count.reset");
PendingIntent pi = PendingIntent.getBroadcast(
kContextManager.getkContext(), 1, intent,
PendingIntent.FLAG_ONE_SHOT);
NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
inboxStyle.setBigContentTitle(kContextManager.getkContext()
.getString(R.string.kndroid));
int textLength = kContextManager.getkContext().getString(R.string.linaial_msg)
.length();
Display display = ((WindowManager) kContextManager
.getkContext().getSystemService(Context.WINDOW_SERVICE))
.getDefaultDisplay();
int lineLength = 38;
int lines = textLength / lineLength + 1;
String[] events = new String[lines];
android.os.Debug.waitForDebugger();
try {
for (int i = 0; i <=lines ; i++) {
if(i*lineLength+lineLength < textLength)
events[i] = kContextManager.getkContext()
.getString(R.string.linaial_msg)
.substring(i*lineLength, i*lineLength + lineLength);
else
events[i] = kContextManager.getkContext()
.getString(R.string.linaial_msg)
.substring(i*lineLength);
inboxStyle.addLine(events[i]);
}
} catch (Exception e) {
e.printStackTrace();
}
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
kContextManager.getkContext())
.setSmallIcon(android.R.drawable.btn_star)
.setContentTitle(
kContextManager.getkContext().getString(
R.string.kndroid))
.setContentText(
kContextManager.getkContext().getString(
R.string.linaial_msg))
.setAutoCancel(true)
.setNumber(0)
.setContentIntent(pi)
.setStyle(inboxStyle)
.setLights(0, 0, 0)
.setTicker(
kContextManager.getkContext().getString(
R.string.linaial_msg))
.setUsesChronometer(true);
mBuilder.setStyle(inboxStyle);
notificationManager.notify((int) 9999, mBuilder.build());
}
짜다보니 이런코드
변수도 좀 깔끔하게 빼주고 해야 하는데
동작만 되면 okay... 이젠... 이렇게 변하는구나.
피드 구독하기:
댓글 (Atom)
UPBIT is a South Korean company, and people died of suicide cause of coin investment.
UPBIT is a South Korean company, and people died of suicide cause of coin. The company helps the people who control the market price manipu...
-
[펌] [UNIX/LINUX 명령어] apropos linux 2005/06/28 22:05 수정 삭제 http://blog.naver.com/wiggyz/80014482910 Mr.You의 블로그 | ?? http:...
-
SELinux 불린 값을 이용해서 SELinux.getBooleanValue("xxxx") SELinux.setBooleanValue("xxxx", yyyy); Policy 에도 if 문을 줄...
-
안드로이드 SDK manager를 쓰다보면 XOOM 때문에 업그레이드가 안된다. 먼 계정을 넣으라고 한다. 안깔면 된다. 깔고 싶으면 에러 메시지에 뜨는 사이트 들어가서 회원 가입하면 그만이다. 간단하다. 들어가서 이메일 주소 넣으면 자기...
조만간 쓸일이 올거 같네요
답글삭제지금 계산기 만들고 잇어요 ㅋㅋㅋㅋㅋㅋ
아오 이벤트 ㅡㅠ
고생하는 동생~~잘하고 있구만~기특띠링똥~~
답글삭제