Пример #1
0
 public static void repeat(String[] args) {
   int repeat = Integer.decode(args[0]);
   ServalD servald = new ServalD();
   for (int i = 0; i != repeat; ++i) {
     servald.command(Arrays.copyOfRange(args, 1, args.length));
     System.out.print(servald.status);
     for (String s : servald.outv) {
       System.out.print(":");
       System.out.print(s);
     }
     System.out.println("");
   }
 }
Пример #2
0
 @Override
 public void onClick(View view) {
   switch (view.getId()) {
     case R.id.btncall:
       startActivity(new Intent(Intent.ACTION_DIAL));
       break;
     case R.id.messageLabel:
       if (!ServalD.isRhizomeEnabled()) {
         app.displayToastMessage("Messaging cannot function without an sdcard");
         return;
       }
       startActivity(
           new Intent(
               getApplicationContext(),
               org.servalproject.messages.MessagesListActivity.class));
       break;
     case R.id.mapsLabel:
       openMaps();
       break;
     case R.id.contactsLabel:
       startActivity(
           new Intent(getApplicationContext(), org.servalproject.ui.ContactsActivity.class));
       break;
     case R.id.settingsLabel:
       startActivity(
           new Intent(
               getApplicationContext(), org.servalproject.ui.SettingsScreenActivity.class));
       break;
     case R.id.sharingLabel:
       startActivity(new Intent(getApplicationContext(), RhizomeMain.class));
       break;
     case R.id.helpLabel:
       Intent intent = new Intent(getApplicationContext(), HtmlHelp.class);
       intent.putExtra("page", "helpindex.html");
       startActivity(intent);
       break;
     case R.id.servalLabel:
       startActivity(new Intent(getApplicationContext(), ShareUsActivity.class));
       break;
     case R.id.powerLabel:
       startActivity(new Intent(getApplicationContext(), Networks.class));
       break;
   }
 }