Android Open Source - Amppercent7 server Activity






From Project

Back to project page Amppercent7.

License

The source code is released under:

GNU General Public License

If you think the Android project Amppercent7 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 my.amppercent.chatrequest;
/*from w  w  w.j av  a  2s. c  o m*/
import my.amppercent.project.TabFragment;
import my.amppercent.project.TextEntryActivity;
import android.app.Activity;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

/**
 * Questa classe implementa la scelta di quale connessione al server (sotto
 * forma di quale utente) utilizzare
 * 
 * @author giacomo
 * 
 */
public class serverActivity extends ListActivity {

  private int position = -1;

  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    String array[] = getIntent().getStringArrayExtra(
        SelectConnActivity.SERVERS);
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
        android.R.layout.simple_list_item_single_choice, array);
    setListAdapter(adapter);
    ListView listView = getListView();
    listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
  }

  @Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);
    Intent stepNext = new Intent(this, TextEntryActivity.class);
    this.position = position;
    stepNext.putExtra("title",
        "Insert the password, cancel to keep the previous.");
    this.startActivityForResult(stepNext, 0);
  }

  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {

    if (requestCode == 0) {
      if (position == -1) {
        Intent i = getIntent();
        setResult(Activity.RESULT_CANCELED, i);
      } else {
        Intent i = getIntent();
        i.putExtra(SelectConnActivity.RESULT, getListView()
            .getItemAtPosition(position).toString());
        i.putExtra(TabFragment.PASSWORD, data.getStringExtra("value"));
        setResult(Activity.RESULT_OK, i);
      }
    }
    finish();
  }

}




Java Source Code List

my.amppercent.adapters.AdapterChat.java
my.amppercent.adapters.AdapterElems.java
my.amppercent.adapters.AdapterIM.java
my.amppercent.adapters.AdapterUStatus.java
my.amppercent.adapters.ListViewAdapting.java
my.amppercent.adapters.ListView_XUser.java
my.amppercent.chatrequest.AvailabilitySettings.java
my.amppercent.chatrequest.SelectConnActivity.java
my.amppercent.chatrequest.connActivity.java
my.amppercent.chatrequest.serverActivity.java
my.amppercent.chattables.UberChat.java
my.amppercent.chattables.XConnect.java
my.amppercent.chattables.XRoster.java
my.amppercent.chattables.myChat.java
my.amppercent.project.Amppercent4Activity.java
my.amppercent.project.DownloadManager.java
my.amppercent.project.IBindRemoteService.java
my.amppercent.project.LaunchMe.java
my.amppercent.project.PrefActive.java
my.amppercent.project.TabFragment.java
my.amppercent.project.TextEntryActivity.java
my.amppercent.remoteservice.IFMessage.java
my.amppercent.remoteservice.IntentManage.java
my.amppercent.remoteservice.XUser.java
my.amppercent.remoteservice.chatAdapter.java
my.amppercent.types.Couple.java
my.amppercent.types.State.java
my.amppercent.types.myATask.java
my.amppercent.types.myNotification.java
my.amppercent.types.myYesNoDialog.java
my.amppercent.types.newActivity.java
org.jivesoftware.smackx.filetransfer.myOutgoingFileTransfer.java