public void onItemClick(AdapterView<?> a, View v, int position, long id) { String key = ((TextItem) a.getAdapter().getItem(position)).text; BibleReference ref = crossReference.get(key); Intent intent = new Intent(); intent.putExtra("linkOSIS", ref.getPath()); setResult(RESULT_OK, intent); finish(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.parallels_list); BibleQuoteApp app = (BibleQuoteApp) getApplication(); myLibrarian = app.getLibrarian(); LV = (ListView) findViewById(R.id.Parallels_List); LV.setOnItemClickListener(list_OnClick); Intent parent = getIntent(); String link = parent.getStringExtra("linkOSIS"); if (link == null) { finish(); return; } bReference = new BibleReference(link); String bookName; try { bookName = myLibrarian.getBookFullName(bReference.getModuleID(), bReference.getBookID()); } catch (OpenModuleException e) { bookName = bReference.getBookFullName(); } TextView referenceSource = (TextView) findViewById(R.id.referenceSource); referenceSource.setText( String.format( "%1$s %2$s:%3$s", bookName, bReference.getChapter(), bReference.getFromVerse())); String progressMessage = getResources().getString(R.string.messageLoad); AsyncManager mAsyncManager = app.getAsyncManager(); mAsyncManager.handleRetainedTask(mTask, this); if (mTask == null) { mTask = new AsyncCommand(new GetParallesLinks(), progressMessage, false); mAsyncManager.setupTask(mTask, this); } }