Android Open Source - ildn-hub Other Activity






From Project

Back to project page ildn-hub.

License

The source code is released under:

GNU General Public License

If you think the Android project ildn-hub listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package net.ildn;
/*www.  ja v a 2  s. c  om*/
import java.util.ArrayList;
import net.ildn.fedorait.R;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

public class OtherActivity extends GlobalMenu {

  private String fonte = "nothing";

  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Intent launchingIntent = getIntent();
    // Imposto sorgente del contenuto web
    fonte = launchingIntent.getExtras().getString("fonte");

    Log.i(fonte + " - OtherActivity", "Richiamato onCreate()");
    setContentView(R.layout.other);

    ArrayList<String> o_list = new ArrayList<String>();
    o_list.add(this.getString(R.string.intestazionedebian));
    o_list.add(this.getString(R.string.intestazionefedora));
    o_list.add(this.getString(R.string.intestazionesuse));
    o_list.add(this.getString(R.string.intestazionemandriva));
    o_list.add(this.getString(R.string.intestazionemageia));
    // aggiungere qui gli altri siti del network

    o_list.trimToSize();
    Log.i(fonte + " - OtherActivity",
        "Dimensione o_list dopo: " + o_list.size());
    setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,
        o_list));

  }

  @Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);

    Log.i(fonte + " - NewsActivity", "Click " + id + " in lista posizione "
        + position);
    switch (position) {
    case 0:
      // Controllo per ovviare di andare su una fonte quando gi ci sono
      if (!this.getString(R.string.intestazionedebian).contains(fonte)) {

        finish();
        startActivity(new Intent("net.ildn.debianitalia.DebianItalia"));
      } else
        Toast.makeText(
            this,
            "Sei gi su "
                + this.getString(R.string.intestazionedebian),
            Toast.LENGTH_SHORT).show();
      return;
    case 1:
      // Controllo per ovviare di andare su una fonte quando gi ci sono
      if (!this.getString(R.string.intestazionefedora).contains(fonte)) {
        finish();
        startActivity(new Intent("net.ildn.fedorait.fedorait"));
      } else
        Toast.makeText(
            this,
            "Sei gi su "
                + this.getString(R.string.intestazionefedora),
            Toast.LENGTH_SHORT).show();
      return;
    case 2:
      // Controllo per ovviare di andare su una fonte quando gi ci sono
      if (!this.getString(R.string.intestazionesuse).contains(fonte)) {
        finish();
        startActivity(new Intent("net.ildn.suseitalia.SuseItalia"));
      } else
        Toast.makeText(
            this,
            "Sei gi su "
                + this.getString(R.string.intestazionesuse),
            Toast.LENGTH_SHORT).show();
      return;
    case 3:
      // Controllo per ovviare di andare su una fonte quando gi ci sono
      if (!this.getString(R.string.intestazionemandriva).contains(fonte)) {
        finish();
        startActivity(new Intent(
            "net.ildn.mandrivaitalia.MandrivaItalia"));
      } else
        Toast.makeText(
            this,
            "Sei gi su "
                + this.getString(R.string.intestazionemandriva),
            Toast.LENGTH_SHORT).show();
      return;
    case 4:
      // Controllo per ovviare di andare su una fonte quando gi ci sono
      if (!this.getString(R.string.intestazionemageia).contains(fonte)) {
        finish();
        startActivity(new Intent(getString(R.string.portalemageia)));
      } else
        Toast.makeText(
            this,
            "Sei gi su "
                + this.getString(R.string.intestazionemageia),
            Toast.LENGTH_SHORT).show();
      return;
    default:
      return;
    }

  }

}




Java Source Code List

net.ildn.Authentication.java
net.ildn.CoverFlow.java
net.ildn.DataRetriever.java
net.ildn.GlobalMenu.java
net.ildn.ImageAdapter.java
net.ildn.ListaPortali.java
net.ildn.NewsAdapter.java
net.ildn.NewsItemRow.java
net.ildn.OtherActivity.java
net.ildn.SexySplash.java
net.ildn.SimpleCrypto.java
net.ildn.Splash.java
net.ildn.UserCredential.java
net.ildn.WebContent.java
net.ildn.debianitalia.DebianBlogActivity.java
net.ildn.debianitalia.DebianForumActivity.java
net.ildn.debianitalia.DebianGuideActivity.java
net.ildn.debianitalia.DebianItalia.java
net.ildn.debianitalia.DebianNewsActivity.java
net.ildn.fedorait.BlogActivity.java
net.ildn.fedorait.ForumActivity.java
net.ildn.fedorait.GuideActivity.java
net.ildn.fedorait.NewsActivity.java
net.ildn.fedorait.fedorait.java
net.ildn.feed.AndroidSaxFeedParser.java
net.ildn.feed.BaseFeedParser.java
net.ildn.feed.FeedParser.java
net.ildn.feed.Message.java
net.ildn.mageiaitalia.MageiaBlogActivity.java
net.ildn.mageiaitalia.MageiaForumActivity.java
net.ildn.mageiaitalia.MageiaGuideActivity.java
net.ildn.mageiaitalia.MageiaItalia.java
net.ildn.mageiaitalia.MageiaNewsActivity.java
net.ildn.mandrivaitalia.MandrivaBlogActivity.java
net.ildn.mandrivaitalia.MandrivaForumActivity.java
net.ildn.mandrivaitalia.MandrivaGuideActivity.java
net.ildn.mandrivaitalia.MandrivaItalia.java
net.ildn.mandrivaitalia.MandrivaNewsActivity.java
net.ildn.suseitalia.SuseBlogActivity.java
net.ildn.suseitalia.SuseForumActivity.java
net.ildn.suseitalia.SuseGuideActivity.java
net.ildn.suseitalia.SuseItalia.java
net.ildn.suseitalia.SuseNewsActivity.java