私はRSSXMLsaxparserに取り組んでいます。アイテムをクリックするとURLが開くように、RSSリストビューを作成しています。しかし、RSS選択リストビューブラウザを非表示にしたい。
RSSリストビューがあり、新しいアクティビティファイルも作成しています。
これと同じタイプの質問を参照 してください。ここで何ができますか?
lv1.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,int position, long id) {
String temp=PostList.get(position).getUrl();
String temp1=PostList.get(position).getGuid();
if(temp.contains("http://"))
{
Intent intent = new Intent(Intent.ACTION_VIEW).setData(Uri.parse(PostList.get(position).getUrl()));
//Intent intent = new Intent(RSSAndroidActivity.this,com.sygnet.rss.Listview.class);
startActivity(intent);
}else if(temp1.contains("http://"))
{
Intent intent = new Intent(Intent.ACTION_VIEW).setData(Uri.parse(PostList.get(position).getGuid()));
//Intent intent = new Intent(RSSAndroidActivity.this,com.sygnet.rss.Listview.class);
startActivity(intent);
}else
{
Toast.makeText(getApplicationContext(), "please, it cant able to open the link for this Feed", Toast.LENGTH_LONG).show();
}
}
});
Listview.java
public class Listview extends Activity{
WebView ourBrow;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.listview);
ourBrow = (WebView)findViewById(R.id.wvBrowser);
ourBrow.getSettings().setJavaScriptEnabled(true);
ourBrow.getSettings().setLoadWithOverviewMode(true);
ourBrow.getSettings().setUseWideViewPort(true);
ourBrow.setWebViewClient(new ourViewClient());
// ourBrow.loadUrl(siteslist.getWebsiteValue());
//hiding the keyboard after using an EditText
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(ourBrow.getWindowToken(), 0);
}
}