본문 바로가기

X-dea

(120)
Second Activity shows blank screen after first Activity starts Intent 1. 앱을 처음 실행했을 때 2. Intent.FLAG_ACTIVITY_CLEAR_TASK, Intent.FLAG_ACTIVITY_NEW_TASK 를 통한 히스토리를 날리고 액티비티를 전환하는 경우 1, 2의 상황에서 activity가 onCreate하기전에 잠시동안 빈 화면이 뜨게됨. 1번의 경우에는 Splash Image를 넣어서 처리하면됨 2번의 경우에는 OnCreate전에 생기는 Preview를 꺼주는 옵션을 이용. 이러한 Style을 적용하면 깔끔하게 액티비티를 띄우거나 전환할 수 있음.
[Gmail API] Load Unread Mail Count Load unread Gmail Count in Android public static void loadUnreadCount(Context context, Account account, GmailNetworkListener listener) { try { GoogleAccountCredential credential = GoogleAccountCredential.usingOAuth2(context, Collections.singleton(MAIL_SCOPE)); credential.setSelectedAccount(account); Gmail service = new Gmail.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential).build(); new GetUnrea..
[Gmail API] Draft Mail Draft Gmail in Android 임시 보관함으로 메일 보내기 public static void sendDraftMail(Context context, Account account, MailDetailObject mailDetailObject, GmailNetworkListener listener) { try { GoogleAccountCredential credential = GoogleAccountCredential.usingOAuth2(context, Collections.singleton(MAIL_SCOPE)); credential.setSelectedAccount(account); Gmail service = new Gmail.Builder(HTTP_TRANSPORT, JSON_FACTO..
[Gmail API] Send Mail Send Gmail in Android. and forward, reply, all-reply public static void sendMail(Context context, Account account, MailDetailObject mailDetailObject, String mailId, GmailNetworkListener listener) { try { GoogleAccountCredential credential = GoogleAccountCredential.usingOAuth2(context, Collections.singleton(MAIL_SCOPE)); credential.setSelectedAccount(account); Gmail service = new Gmail.Builder(HT..
[Gmail API] Search Mail Search Gmail in Android public static void searchMailList(Context context, Account account, String searchType, String searchWord, GmailNetworkListener listener) { try { GoogleAccountCredential credential = GoogleAccountCredential.usingOAuth2(context, Collections.singleton(MAIL_SCOPE)); credential.setSelectedAccount(account); Gmail service = new Gmail.Builder(HTTP_TRANSPORT, JSON_FACTORY, credent..
[Gmail API] Delete Label Delete Gmail Label in Android public static void deleteLabel(Context context, Account account, String labelId, GmailNetworkListener listener) { try { GoogleAccountCredential credential = GoogleAccountCredential.usingOAuth2(context, Collections.singleton(MAIL_SCOPE)); credential.setSelectedAccount(account); Gmail service = new Gmail.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential).build(); new D..
[Gmail API] Create Label Create Gmail Label in Android public static void createLabel(Context context, Account account, String labelName, GmailNetworkListener listener) { try { GoogleAccountCredential credential = GoogleAccountCredential.usingOAuth2(context, Collections.singleton(MAIL_SCOPE)); credential.setSelectedAccount(account); Gmail service = new Gmail.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential).build(); new..
[Gmail API] Update Label 폴더명 변경 public static void updateLabel(Context context, Account account, String labelId, String labelName, GmailNetworkListener listener) { try { GoogleAccountCredential credential = GoogleAccountCredential.usingOAuth2(context, Collections.singleton(MAIL_SCOPE)); credential.setSelectedAccount(account); Gmail service = new Gmail.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential).build(); new Update..