Ejemplo n.º 1
0
  @Override
  public void onCustomCommand(int id) {
    super.onCustomCommand(id);
    if (id == COMMAND_ID_SHARE) {
      Artwork currentArtwork = getCurrentArtwork();
      Intent shareWall = new Intent(Intent.ACTION_SEND);
      shareWall.setType("text/plain");

      String wallName = currentArtwork.getTitle();
      String authorName = currentArtwork.getByline();
      String storeUrl = MARKET_URL + getResources().getString(R.string.package_name);
      String iconPackName = getString(R.string.app_name);

      shareWall.putExtra(
          Intent.EXTRA_TEXT,
          getString(R.string.partone)
              + wallName
              + getString(R.string.parttwo)
              + authorName
              + getString(R.string.partthree)
              + iconPackName
              + getString(R.string.partfour)
              + storeUrl);

      shareWall = Intent.createChooser(shareWall, getString(R.string.share_via));
      shareWall.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
      startActivity(shareWall);
    }
  }
Ejemplo n.º 2
0
  @Override
  public void onCreate() {
    super.onCreate();

    wdb = new WallsDatabase(getApplicationContext());
    wallslist = new ArrayList<>();

    mPrefs = new Preferences(ArtSource.this);

    ArrayList<UserCommand> commands = new ArrayList<>();
    commands.add(new UserCommand(BUILTIN_COMMAND_ID_NEXT_ARTWORK));
    commands.add(new UserCommand(COMMAND_ID_SHARE, getString(R.string.justshare)));

    setUserCommands(commands);
  }
 @Override
 public void onCreate() {
   super.onCreate();
   setUserCommands(BUILTIN_COMMAND_ID_NEXT_ARTWORK);
 }