package ve.gob.cenditel.tibisaymovil; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.util.SparseBooleanArray; import android.view.View; import android.view.Window; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.LinearLayout; import android.widget.ListView; public class FilesToPDFSignConfirmationActivity extends Activity implements OnClickListener, OnItemClickListener { private List uris; private ListView listView; private LinearLayout next; private LinearLayout back; private ArrayAdapter listAdapter; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final boolean customTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); this.setContentView(R.layout.confirmationlist); if(customTitleSupported) getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title_bar); this.next = (LinearLayout) this.findViewById(R.id.button_next_zone); this.next.setOnClickListener(this); this.back = (LinearLayout) this.findViewById(R.id.button_back_zone); this.back.setOnClickListener(this); this.uris = getIntent().getStringArrayListExtra(IntentExtraField.FILES); this.listAdapter = new ArrayAdapter(this,R.layout.confirmation_item, this.uris); this.listView = (ListView) this.findViewById(R.id.confirmation_list); this.listView.setAdapter(this.listAdapter); this.listView.setOnItemClickListener(this); this.listAdapter.notifyDataSetChanged(); //Estilando Barra de titulo if(customTitleSupported) getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title_bar); } @Override public void onStart(){ super.onStart(); for (int i=0;i sublist = new ArrayList(); for (int i = 0; i < sparse.size(); i++) { if( sparse.valueAt(i)== true){ sublist.add((String)this.listAdapter.getItem(sparse.keyAt(i))); } } if (sublist.size()>0){ intent.putStringArrayListExtra(IntentExtraField.FILES, sublist); this.setResult(RESULT_OK, intent); finish(); }else{} break; } } @Override public void onItemClick(AdapterView arg0, View arg1, int arg2, long arg3) { SparseBooleanArray checked = this.listView.getCheckedItemPositions(); boolean found=false; for (int i=0; i