如何隐藏浏览器地址栏? [英] How to hide the browser address bar?

查看:274
本文介绍了如何隐藏浏览器地址栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个code,我的工作在Twitter的RSS提要
我有main.xml中列表视图还 但我要如何我隐藏浏览器的地址bar.when我是点击Twitter的饲料那个时候隐藏浏览器的地址栏中

I have this code, I am working on twitter rss feeds
I have main.xml list view also But i want to how to i hide the browser address bar.when i am click the twitter feed that time hide the browser address bar

xmlparsemain.java

xmlparsemain.java

public class xmlparsemain extends DashBoardActivity {
/** Called when the activity is first created. */
WebView ourBrow;
ListView lv1;
ProgressDialog ShowProgress;
public ArrayList<Post> PostList = new ArrayList<Post>();
public SitesList siteslist =new SitesList();

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // making it full screen
    requestWindowFeature(Window.FEATURE_NO_TITLE);
            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.twitter);

    setHeader(getString(R.string.Twitter), true, true, true);

    System.out.println(siteslist.getTwitterValue());

    lv1 = (ListView) findViewById(R.id.listView1);

    ShowProgress = ProgressDialog.show(xmlparsemain.this, "","Loading. Please wait...", true);
            new loadingTask().execute("http://api.twitter.com/1/statuses/user_timeline.rss?screen_name="+siteslist.getTwitterValue().toString()+"");


    lv1.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View view,int position, long id) {

            Intent intent = new Intent(Intent.ACTION_VIEW).setData(Uri.parse(PostList.get(position).getUrl()));
            startActivity(intent);
//              ourBrow.getSettings().setJavaScriptEnabled(true);
//              ourBrow.getSettings().setLoadWithOverviewMode(true);
//              ourBrow.getSettings().setUseWideViewPort(true);
//              ourBrow.setWebViewClient(new Intent(Intent.ACTION_VIEW).setData(Uri.parse(PostList.get(position).getUrl())));
//              ourBrow.setWebViewClient(new ourViewClient());
//              InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
//              imm.hideSoftInputFromWindow(ourBrow.getWindowToken(), 0);

        }
    });

}
class loadingTask extends AsyncTask<String, Void, String> {

    protected String doInBackground(String... urls) {

        SAXHelper sh = null;
        try {
            sh = new SAXHelper(urls[0]);
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
        sh.parseContent("");
        return "";
    }

    protected void onPostExecute(String s) {
        lv1.setAdapter(new EfficientAdapter(xmlparsemain.this, PostList));
        ShowProgress.dismiss();
    }
}
class SAXHelper {
    public HashMap<String, String> userList = new HashMap<String, String>();
    private URL url2;

    public SAXHelper(String url1) throws MalformedURLException {
        this.url2 = new URL(url1);
    }
    public RSSHandler parseContent(String parseContent) {
        RSSHandler df = new RSSHandler();
        try {
            SAXParserFactory spf = SAXParserFactory.newInstance();
            SAXParser sp = spf.newSAXParser();
            XMLReader xr = sp.getXMLReader();
            xr.setContentHandler(df);
            xr.parse(new InputSource(url2.openStream()));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return df;
    }
}
class RSSHandler extends DefaultHandler {
    private Post currentPost = new Post();
    StringBuffer chars = new StringBuffer();
    @Override
    public void startElement(String uri, String localName, String qName,Attributes atts) {
        chars = new StringBuffer();
        if (localName.equalsIgnoreCase("item")) {
        }
    }

    @Override
    public void endElement(String uri, String localName, String qName)
            throws SAXException {

        if (localName.equalsIgnoreCase("title") && currentPost.getTitle() == null) {
        currentPost.setTitle(chars.toString());
        }

        if (localName.equalsIgnoreCase("pubDate")&& currentPost.getDate() == null) {
            currentPost.setDate(chars.toString());
        }
        if (localName.equalsIgnoreCase("link")&& currentPost.getUrl() == null) {
            currentPost.setUrl(chars.toString());
        }

        if (localName.equalsIgnoreCase("item")) {
            PostList.add(currentPost);
            currentPost = new Post();
        }
    }

    @Override
    public void characters(char ch[], int start, int length) {
        chars.append(new String(ch, start, length));
    }
}
}

post.java

post.java

public class Post {

private String title;
private String thumbnail;
private String url;
private String description;
private String date;

public String getTitle() {
    return title;
}

public void setTitle(String title) {
    this.title = title;
}

public String getThumbnail() {
    return thumbnail;
}

public void setThumbnail(String thumbnail) {
    this.thumbnail = thumbnail;
}

public String getUrl() {
    return url;
}

public void setUrl(String url) {
    this.url = url;
}

public void setDescription(String description) {
    this.description = description;
}

public String getDescription() {
    return description;
}

public void setDate(String date)  {
      this.date=date;      
    }

public String getDate() {
    return date;
}

}

EfficientAdapter.java

EfficientAdapter.java

 public class EfficientAdapter extends BaseAdapter {
private Activity activity;
private ArrayList<Post> data;
private static LayoutInflater inflater = null;
//public ImageLoader imageLoader;
ViewHolder holder;

EfficientAdapter(Activity a, ArrayList<Post> d) {

    activity = a;
    data = d;
    inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}

@Override
public int getCount() {
    return data.toArray().length;
}

@Override
public Object getItem(int position) {
    return position;
}

@Override
public long getItemId(int position) {
    return position;
}

public static class ViewHolder {
    public TextView label;

    public TextView addr;
            public ImageView image;
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    View vi = convertView;

    if (convertView == null) {
        vi = inflater.inflate(R.layout.row, null);
        holder = new ViewHolder();
        holder.label = (TextView) vi.findViewById(R.id.title);
        holder.addr = (TextView) vi.findViewById(R.id.details);
        holder.image = (ImageView) vi.findViewById(R.id.thumb);
        vi.setTag(holder);

    } else

    holder = (ViewHolder) vi.getTag();
    Resources res = activity.getResources();
    holder.label.setText(data.get(position).getTitle());
    holder.addr.setText(data.get(position).getDate());
    Bitmap micon1=BitmapFactory.decodeResource(res, R.drawable.tweet); 
    holder.image.setImageBitmap(Bitmap.createScaledBitmap(micon1, 72, 72, false));
    return vi;
}

 }

如何我隐藏在浏览器地址栏

How to i Hide the browser address bar

推荐答案

据我所知,你不能,除非上弹出。由于它适用于安卓(因为你标记你的问题对于Android),浏览器栏应该在客户端上自动隐藏结束,因为他们滚动(和滚动条,直到它检测触摸交互)。这是弹出窗口code删除浏览器栏(如果需要滚动条,以及,):

As far as I know, you cannot, except on popups. As it applies to Android (since you tagged your question for Android), the browser bar should auto-hide on the client end as they scroll (and the scroll bars until it senses a touch interaction). Here is pop-up window code to remove the browser bar (and scrollbar as well, if needed):

var popup = window.open("http://urlinquestion.com", "newPOPUP", 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=300')

这篇关于如何隐藏浏览器地址栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆