Beispiel #1
0
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
   switch (item.getItemId()) {
     case R.id.context_menu_home:
       startActivity(Utils.createHomeIntent(this));
       return true;
     default:
       return super.onOptionsItemSelected(item);
   }
 }
Beispiel #2
0
 private String getRawResourceContent(int rawResourceId) {
   String content = "";
   InputStream input = null;
   try {
     input = getResources().openRawResource(rawResourceId);
     content = Utils.copyStreamToString(input);
   } catch (IOException e) {
     Log.e(IMongolduuConstants.LOG_TAG, "exception", e);
   } finally {
     if (input != null) {
       try {
         input.close();
       } catch (IOException e) {
       }
     }
   }
   return content;
 }