Back to project page AndroidWearable-Samples.
The source code is released under:
Apache License
If you think the Android project AndroidWearable-Samples listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.android.wearable.recipeassistant; /*from www .java 2 s .com*/ import android.app.ListActivity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.ListView; public class MainActivity extends ListActivity { private static final String TAG = "RecipeAssistant"; private RecipeListAdapter mAdapter; @Override protected void onListItemClick(ListView l, View v, int position, long id) { if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG , "onListItemClick " + position); } String itemName = mAdapter.getItemName(position); Intent intent = new Intent(getApplicationContext(), RecipeActivity.class); intent.putExtra(Constants.RECIPE_NAME_TO_LOAD, itemName); startActivity(intent); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(android.R.layout.list_content); mAdapter = new RecipeListAdapter(this); setListAdapter(mAdapter); } }