I have a webview control that needs to support the fling gesture in Android in order to bring up a new record (load new data). This is occuring in a class that extends Activity. All the examples I've seen show how to implement gesture support for a textview, but nothing for webview.
I need to execute different actions for both left and right flings. Any code help would be appreciated as this totally has me stumped.
Here's my basic onCreate and my class
import android.app.Activity;
import android.content.Intent;
import android.database.Cursor;
import android.database.SQLException;
import android.os.Bundle;
import android.text.Html;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.webkit.WebView;
public class ArticleActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Window w = getWindow();
w.requestFeature(Window.FEATURE_LEFT_ICON);
WebView webview = new WebView(this);
setContentView(webview);
w.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,
R.drawable.gq);
setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
populateFields();
webview.loadData(question + answer, "text/html", "utf-8");
//
}
private void populateFields() {
....
}
}