Exemple #1
0
 public static int initFragement(BaseFragment fragment) {
   try {
     Class<? extends BaseFragment> cls = fragment.getClass();
     ELayout eView = cls.getAnnotation(ELayout.class);
     if (eView != null) {
       int id = eView.Layout();
       return id;
     } else {
       return -1;
     }
   } catch (Exception e) {
     return -1;
   }
 }
Exemple #2
0
 public static int initWindow(BaseActivity activity) throws Exception {
   try {
     Class<? extends BaseActivity> cls = activity.getClass();
     ELayout eView = cls.getAnnotation(ELayout.class);
     if (eView != null) {
       int id = eView.Layout();
       activity.setContentView(id);
       return id;
     } else {
       throw new Exception("XML File Not Found!");
     }
   } catch (Exception e) {
     if (LogConfig.Debug) Logs.logE(e);
     throw new Exception("XML File Not Found!");
   }
 }