probleme webview dans une vue complexe
Bonjour
j ai une vue composé comme suit:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ListView android:id="@+id/list"
android:layout_gravity="left"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="fill_parent">
</ListView>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1"
/>
</LinearLayout> |
voici mon activité...
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
package com.xxx.xxx;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import android.app.Activity;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.webkit.WebView;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;
import com.xxx.xxx.adapter.ListSeparer;
import com.xxx.xxx.adapter.RendezVousAdapter;
import com.xxx.xxx.bean.Client;
import com.xxx.xxx.bean.RendezVous;
import com.xxx.xxx.bean.Vehicule;
import com.xxx.xxx.data.GestionDB;
public class RendezVousActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(com.inetpsa.IBOX.R.layout.main);
//Récupération du composant ListView
ListView list = (ListView)findViewById(R.id.list);
WebView mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl("http://www.google.com");
GestionDB gg = new GestionDB(this);
gg.ouvrirSiFermee();
Cursor listeRdvFromBase = gg.recupererListeRDV();
//Récupération de la liste des personnes
HashMap<String ,List<RendezVous>> map = genererListeRdv(listeRdvFromBase);
// creation de nom objet de type ListSeparer
ListSeparer adapter = new ListSeparer(this);
// Map<TypeClefs,TypeValeurs> map = new ClasseImplementantMap<TypeClefs,TypeValeurs>
for (Iterator<String> i = map.keySet().iterator() ; i.hasNext() ; ){
String key = i.next();
adapter.addSection( key, new RendezVousAdapter(this,map.get(key)));
}
list.setAdapter(adapter);
list.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView parent, View view, int position, long id) {
Intent intent = new Intent();
intent.setClass(getApplicationContext(), Toto.class);
startActivity(intent);
}
});
}
} |
Mon probleme est le suivant ...la vebview n est plus "cliquable", impossible d acceder au lien par exemple. tout ce passe comme si le onclick n etait plus geré.... quelqu'un a t il une idée ??
bien andoïdement votre...