Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid: TabListener, unimplemented methods
    primarykey
    data
    text
    <p>I have a class MyTabsListener inside my main activity as follows:</p> <p><strong>Tabs Listener Class:</strong></p> <pre><code>class MyTabsListener implements ActionBar.TabListener { public Fragment frag = new Fragment(); public MyTabsListener(Fragment fragment) { this.frag = fragment; } public void onTabReselected(Tab tab, FragmentTransaction ft) { Toast.makeText(JSONActivity.appContext, "Reselected!", Toast.LENGTH_LONG).show(); } public void onTabSelected(Tab tab, FragmentTransaction ft) { ft.replace(R.id.fragment_container, frag); } public void onTabUnselected(Tab tab, FragmentTransaction ft) { ft.remove(frag); } } </code></pre> <p>I am using the support.v4 libraries when importing fragment, fragmenttransaction, etc..</p> <p>However, eclipse tells me that: <em>The type MyTabsListener must implement the inherited abstract method ActionBar.TabListener.onTabSelected(ActionBar.Tab, FragmentTransaction)</em></p> <p>How can I fix this? If I change the class signature to:</p> <p><code>public void onTabSelected(Tab tab, android.app.FragmentTransaction ft)</code></p> <p>for example, then the method <code>ft.replace</code> or <code>ft.remove</code> will give me an error.</p> <p><strong>My imports are:</strong></p> <pre><code>import android.os.Bundle; import java.io.BufferedReader; import java.io.IOException; import android.annotation.SuppressLint; import android.app.ActionBar; import android.app.ActionBar.Tab; import android.app.Activity; import android.content.Context; import java.io.InputStream; import java.io.InputStreamReader; import java.util.HashMap; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.StatusLine; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.DefaultHttpClient; import org.json.JSONArray; import org.json.JSONObject; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentTransaction; import android.util.Log; import android.view.Menu; import android.view.MenuInflater; import android.widget.Toast; import android.os.AsyncTask; </code></pre> <p>Any ideas?</p> <p>Thanks in advance!</p>
    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.
    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