Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid-manifest issue
    primarykey
    data
    text
    <p>I have written a code allow the user when click on an item in list-view to go to another activity. But an error happened.The emulator asked me if I have added the new activity in the android-manifest!!.<br> I have done that .<br> what I suppose to do? </p> <p>Here is the Full stack trace.</p> <pre><code>07-24 12:20:35.263: E/AndroidRuntime(455): FATAL EXCEPTION: main 07-24 12:20:35.263: E/AndroidRuntime(455): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.tstnetconnwithjson/com.example.tstnetconnwithjson.tables.full}; have you declared this activity in your AndroidManifest.xml? 07-24 12:20:35.263: E/AndroidRuntime(455): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404) 07-24 12:20:35.263: E/AndroidRuntime(455): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378) 07-24 12:20:35.263: E/AndroidRuntime(455): at android.app.Activity.startActivityForResult(Activity.java:2817) 07-24 12:20:35.263: E/AndroidRuntime(455): at android.app.Activity.startActivity(Activity.java:2923) 07-24 12:20:35.263: E/AndroidRuntime(455): at com.example.tstnetconnwithjson.MainActivity$conn$1.onItemClick(MainActivity.java:195) 07-24 12:20:35.263: E/AndroidRuntime(455): at android.widget.AdapterView.performItemClick(AdapterView.java:284) 07-24 12:20:35.263: E/AndroidRuntime(455): at android.widget.ListView.performItemClick(ListView.java:3382) 07-24 12:20:35.263: E/AndroidRuntime(455): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1696) 07-24 12:20:35.263: E/AndroidRuntime(455): at android.os.Handler.handleCallback(Handler.java:587) 07-24 12:20:35.263: E/AndroidRuntime(455): at android.os.Handler.dispatchMessage(Handler.java:92) 07-24 12:20:35.263: E/AndroidRuntime(455): at android.os.Looper.loop(Looper.java:123) 07-24 12:20:35.263: E/AndroidRuntime(455): at android.app.ActivityThread.main(ActivityThread.java:4627) 07-24 12:20:35.263: E/AndroidRuntime(455): at java.lang.reflect.Method.invokeNative(Native Method) 07-24 12:20:35.263: E/AndroidRuntime(455): at java.lang.reflect.Method.invoke(Method.java:521) 07-24 12:20:35.263: E/AndroidRuntime(455): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 07-24 12:20:35.263: E/AndroidRuntime(455): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 07-24 12:20:35.263: E/AndroidRuntime(455): at dalvik.system.NativeStart.main(Native Method) </code></pre> <p>Here is the maifest file:</p> <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.tstnetconnwithjson" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /&gt; &lt;uses-permission android:name="android.permission.INTERNET"/&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" &gt; &lt;activity android:name=".MainActivity" android:label="@string/title_activity_main" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name="full"&gt;&lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p>Here is the code where I have called start activity:</p> <pre><code>import java.util.ArrayList; import java.util.Collection; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.impl.conn.DefaultClientConnection; import org.apache.http.protocol.HTTP; import org.apache.http.util.EntityUtils; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.json.JSONTokener; import com.example.tstnetconnwithjson.tables.custome; import com.example.tstnetconnwithjson.tables.videos; import android.os.AsyncTask; import android.os.Bundle; import android.app.Activity; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.app.ProgressDialog; import android.content.DialogInterface; import android.util.Log; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import android.widget.TextView; public class MainActivity extends Activity { Button search; ; TextView name ; ListView listview ; ArrayList&lt;videos &gt; videolist; ArrayAdapter&lt; videos &gt; adapter ; AlertDialog.Builder alert ; ProgressDialog progressdialog ; EditText name; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); videolist = new ArrayList&lt;videos&gt;(); adapter = new ArrayAdapter&lt;videos&gt;(this, android.R.layout.simple_list_item_1 , android.R.id.text1,videolist); name=(EditText) findViewById(R.id.editText1); alert = new Builder(this); alert.setTitle("Warnning" ) ; alert.setMessage("You want to connect to the internet ..? " ); alert.setNegativeButton("No ", null); alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() { public void onClick(DialogInterface arg0, int arg1) { String username=name.getText().toString(); new connection().execute("https://gdata.youtube.com/feeds/api/videos?author="+username+"&amp;v=2&amp;alt=jsonc"); } }); progressdialog = new ProgressDialog(this); progressdialog.setMessage("Wait Loading .... "); progressdialog.setCancelable(false); search = (Button) findViewById(R.id.button1); name = (TextView) findViewById(R.id.textView1); listview = (ListView) findViewById(R.id.listView1); listview.setAdapter(adapter); search.setOnClickListener(new OnClickListener() { public void onClick(View arg0) { alert.show(); } }); } class connection extends AsyncTask&lt;String, Integer, String&gt;{ @Override protected void onPreExecute() { progressdialog.show(); super.onPreExecute(); } @Override protected String doInBackground(String... arg0) { String s = GetUrlBody(arg0[0]); return s; } @Override protected void onPostExecute(String result) { try{ JSONObject jo =(JSONObject) new JSONTokener(result).nextValue(); JSONObject feed = jo.optJSONObject("data"); JSONArray entry = feed.optJSONArray("items"); for(int i = 0 ; i&lt;entry.length() ; i++){ String title = entry.getJSONObject(i).getString("title"); String thumbURL = entry.getJSONObject(i).getJSONObject("thumbnail").getString("sqDefault"); Log.d("after get image", "ok") String url; try { url = entry.getJSONObject(i).getJSONObject("player").getString("mobile"); } catch (JSONException ignore) { url = entry.getJSONObject(i).getJSONObject("player").getString("default"); } String description = entry.getJSONObject(i).getString("description"); Log.d("after get description", "ok"); videos videoobject=new videos(); videoobject.setDecscrption(description); videoobject.setImageurl(thumbURL); videoobject.setVediourl(url); videoobject.setVideoname(title); videolist.add(videoobject); } listview.setAdapter(new custome(MainActivity.this,videolist)); Log.d("AFTER set custome ", "before notify changes"); adapter.notifyDataSetChanged(); lview.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) { videos vobject=(videos)arg0.getItemAtPosition(arg2); Intent intent = new Intent(getApplicationContext(),full.class); intent.putExtra("title" ,vobject.getVideoname() ); intent.putExtra("description" ,vobject.getDecscrption() ); intent.putExtra("imageURL" ,vobject.getImageurl() ); intent.putExtra("videoURL" ,vobject.getVediourl() ); startActivity(intent); } }); }catch(Exception exception) { Log.d("exception ", "nock nock nock...."); Log.e("json ", exception.getMessage()); } progressdialog.dismiss(); super.onPostExecute(result); } String GetUrlBody (String Url ){ HttpClient client = new DefaultHttpClient(); HttpGet gethttp = new HttpGet(Url); try{ HttpResponse response = client.execute(gethttp); if(response.getStatusLine().getStatusCode() == 200){ String save = EntityUtils.toString(response.getEntity(), HTTP.UTF_8); return save; }else { return "Not Found"; } }catch(Exception exception){} return null; } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload