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...
-
프루나는 이제 믿을만한 공유가 안되고 있다. 젠장. 영화 다운 받아보면 전부 야동이나 포르노류 밖에는 없다. 신고되어 있는 자료부터 보지만 신고가 안되어 있는 것은 제대로 다운도 되지 않는다. 이젠 유료 사이트를 믿을 수 밖엔... ...
-
Intel의 새로운 MMX - "KNI" KNI 는 Katmai New Instruction 의 약자이다 . 아는 분들은 잘 알고있겠지만 KATMAI( 이하 카트마이로 부름 ) 는 인텔의 다음번 펜티엄...
-
C:\program files\ 베이비론 폴더가 있다. 브라우저 창 다닫고 지우고 다시 실행하면 없어진다.
조만간 쓸일이 올거 같네요
답글삭제지금 계산기 만들고 잇어요 ㅋㅋㅋㅋㅋㅋ
아오 이벤트 ㅡㅠ
고생하는 동생~~잘하고 있구만~기특띠링똥~~
답글삭제