예제 #1
0
 @SuppressWarnings("unchecked")
 public ICase<FragmentActivity> getCase() {
   if (kase == null) {
     kase = (ICase<FragmentActivity>) App.get().findChildCase(getCaseName());
   }
   Logger.check(kase != null, getCaseName() + " has not been created!");
   return kase;
 }
예제 #2
0
 protected void log(String msg) {
   Logger.info(
       "*"
           + (getCase() == null ? getClass().getName() : getCase().getFullName())
           + "("
           + Integer.toHexString(this.hashCode())
           + ") : "
           + msg);
 }
예제 #3
0
 public XmlDataService() {
   try {
     int i;
     IDataNode node =
         XmlHelper.parse(
             XmlHelper.createParser(App.get().getAssets().open("PreloadData.xml"), "UTF-8"));
     IDataView<IDataNode> cs = new DataNodeView(node, "Categories/Category");
     for (i = 0; i < cs.getItemCount(); i++) {
       Category c = new Category();
       c.copyPropertiesFrom(cs.getItem(i));
       categories.addItem(c);
     }
     IDataView<IDataNode> ps = new DataNodeView(node, "Products/Product");
     for (i = 0; i < ps.getItemCount(); i++) {
       Product p = new Product();
       p.copyPropertiesFrom(ps.getItem(i));
       products.addItem(p);
     }
   } catch (IOException e) {
     Logger.error(e.getMessage());
   }
 }
 @Override
 public void onCreate() {
   super.onCreate();
   Logger.debug("SampleApplication.onCreate");
 }