gpt4 book ai didi

android - 如何在 Android 中隐藏 RSS ListView 浏览器

转载 作者:搜寻专家 更新时间:2023-11-01 08:08:15 24 4
gpt4 key购买 nike

我正在研究 RSS XML saxparser。我正在创建 RSS ListView ,以便单击任何项​​目都会打开 URL。但我想隐藏 RSS 选择 ListView 浏览器。

我也有 RSS ListView 和创建新的 Activity 文件。

See this same type of question我可以在这里做什么?

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);

}
}

最佳答案

public class WebViewActivity extends DashBoardActivity {
/** Called when the activity is first created. */
WebView ourBrow;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.webview);


ourBrow = (WebView)findViewById(R.id.wvBrowser);

ourBrow.getSettings().setJavaScriptEnabled(true);
ourBrow.getSettings().setLoadWithOverviewMode(true);
ourBrow.getSettings().setUseWideViewPort(true);
ourBrow.setWebViewClient(new ourViewClient());

ourBrow.loadUrl(www.indianbloggerpost.com);

//hiding the keyboard after using an EditText
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(ourBrow.getWindowToken(), 0);



}

关于android - 如何在 Android 中隐藏 RSS ListView 浏览器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12382385/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com