Android Open Source - One-Button-App---Android choose Image






From Project

Back to project page One-Button-App---Android.

License

The source code is released under:

Copyright (c) 2002,2003, Stefan Haustein, Oberhausen, Rhld., Germany Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (...

If you think the Android project One-Button-App---Android 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 edu.cc.oba;
// w ww . j  a  va  2  s . c om
import java.util.HashMap;
import java.util.Iterator;


import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;

public class chooseImage extends Activity {
    /** Called when the activity is first created. */
  public int image_id=0;
  public String[] conn_data;
  public static Boolean flag=false;
  
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.chooseimage);
                
        Intent this_intent= getIntent();
        String username=this_intent.getStringExtra("username");
        String password=this_intent.getStringExtra("password");
        
//        TestOBA.getUserObject(username, password);
                
        ArrayAdapter <CharSequence> adapter =
              new ArrayAdapter <CharSequence> (this, android.R.layout.simple_spinner_item );
            adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
             
            //GET IMAGE LIST FOR USER
            Object[] images=TestOBA.oba.getImagesID();
            
            for(int i=0;i<images.length;i++)
            {
              adapter.add(((HashMap) images[i]).toString());
            }
            
            final Spinner s = (Spinner) findViewById(R.id.image_spinner);
            
            s.setAdapter(adapter);
            
            Log.d("Selected ITEM", s.getSelectedItem().toString());
            
          
            s.setOnItemSelectedListener(new OnItemSelectedListener() {

          @Override
          public void onItemSelected(AdapterView<?> arg0, View arg1,
              int arg2, long arg3) {
            // TODO Auto-generated method stub
            String[] items=s.getSelectedItem().toString().split(",");    
            image_id=Integer.parseInt(items[0].substring(4));    
            Log.d("ID",""+image_id);
          }

          @Override
          public void onNothingSelected(AdapterView<?> arg0) {
            // TODO Auto-generated method stub
            image_id=1908;
            
          }
              
        });
            
            
 
    }
    
    
    
    
    public void image_Reserve(View v)
  {
      
      
      makeReservation reserveTask=TestOBA.oba.new makeReservation();
      Log.d("Trying to make reservation for ", ""+image_id);
      reserveTask.execute(image_id);
          }
    
    
}




Java Source Code List

edu.cc.oba.Android_OBAActivity.java
edu.cc.oba.Android_OBAActivity.java
edu.cc.oba.ConnectWithPass.java
edu.cc.oba.ConnectWithPass.java
edu.cc.oba.CopyOfcreateConnection.java
edu.cc.oba.CopyOfcreateConnection.java
edu.cc.oba.ImageDB.java
edu.cc.oba.TestOBA.java
edu.cc.oba.TestOBA.java
edu.cc.oba.chooseImage.java
edu.cc.oba.chooseImage.java
edu.cc.oba.createConnection.java
edu.cc.oba.createConnection.java
edu.cc.oba.mainUITabs.java
edu.cc.oba.mainUITabs.java
edu.cc.oba.oneButtons.java
edu.cc.oba.oneButtons.java
org.apache.http.examples.client.ClientAbortMethod.java
org.apache.http.examples.client.ClientAuthentication.java
org.apache.http.examples.client.ClientChunkEncodedPost.java
org.apache.http.examples.client.ClientConnectionRelease.java
org.apache.http.examples.client.ClientCustomContext.java
org.apache.http.examples.client.ClientCustomSSL.java
org.apache.http.examples.client.ClientEvictExpiredConnections.java
org.apache.http.examples.client.ClientExecuteDirect.java
org.apache.http.examples.client.ClientExecuteProxy.java
org.apache.http.examples.client.ClientExecuteSOCKS.java
org.apache.http.examples.client.ClientFormLogin.java
org.apache.http.examples.client.ClientGZipContentCompression.java
org.apache.http.examples.client.ClientInteractiveAuthentication.java
org.apache.http.examples.client.ClientKerberosAuthentication.java
org.apache.http.examples.client.ClientMultiThreadedExecution.java
org.apache.http.examples.client.ClientPreemptiveBasicAuthentication.java
org.apache.http.examples.client.ClientPreemptiveDigestAuthentication.java
org.apache.http.examples.client.ClientProxyAuthentication.java
org.apache.http.examples.client.ClientWithResponseHandler.java
org.apache.http.examples.conn.ManagerConnectDirect.java
org.apache.http.examples.conn.ManagerConnectProxy.java
org.apache.http.examples.conn.OperatorConnectDirect.java
org.apache.http.examples.conn.OperatorConnectProxy.java
org.apache.http.examples.entity.mime.ClientMultipartFormPost.java
org.kxml2.wap.WbxmlParser.java
org.kxml2.wap.WbxmlSerializer.java
org.kxml2.wap.wml.Wml.java
org.xmlrpc.android.Base64Coder.java
org.xmlrpc.android.IXMLRPCSerializer.java
org.xmlrpc.android.MethodCall.java
org.xmlrpc.android.Tag.java
org.xmlrpc.android.XMLRPCClient.java
org.xmlrpc.android.XMLRPCCommon.java
org.xmlrpc.android.XMLRPCException.java
org.xmlrpc.android.XMLRPCFault.java
org.xmlrpc.android.XMLRPCSerializable.java
org.xmlrpc.android.XMLRPCSerializer.java
org.xmlrpc.android.XMLRPCServer.java