I want to know to get browse history on android ?

by eaindra nilar » Thu, 03 Sep 2009 09:15:17 GMT


Sponsored Links
 Thank
Sorry,
 I mean, I want to pull out web histroy from content provider  for my
application.



I have some coding. But I got exception .

So, how can I do ?please help me.
Here are my coding
package com.app.browser;


import android.app.ListActivity;
import android.database.Cursor;
import android.os.Bundle;
import android.widget.ListAdapter;
import android.widget.SimpleCursorAdapter;



public class BrowserApp extends ListActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.list_activity_view);
        //Cursor
browserinfo=android.provider.Browser.getAllVisitedUrls(getContentResolver());

        String []proj= new String
[]{android.provider.Browser.SearchColumns._ID,
                android.provider.Browser.SearchColumns.DATE,
                android.provider.Browser.SearchColumns.SEARCH};
        Cursor results=

managedQuery(android.provider.Browser.SEARCHES_URI,proj,null,null,
android.provider.Browser.SearchColumns.URL+" ASC");
       /* if (results.moveToFirst())
        {
            do {
                DisplayTitle(results);
            } while (results.moveToNext());
        }


    }
    public void DisplayTitle(Cursor c)
    {

Toast.makeText(this,"url:"+c.getString(0)+"\t"+"search:"+c.getString(1)+"\t"+c.getString(2),Toast.LENGTH_LONG).show();

    }*/

        ListAdapter adapter = new SimpleCursorAdapter(
                this, // Context.
                android.R.layout.two_line_list_item,  // Specify the row
template to use (here, two columns bound to the two retrieved cursor rows).
                results,                                    // Pass in the
cursor to bind to.
                proj, // Array of cursor columns to bind to.
                new int[0]);                                 // Parallel
array of which template objects to bind to those columns.

        // Bind to our new adapter.
        setListAdapter(adapter);

        }
    }

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. problem: ListView item selection with EditText

I have a problem. I have a String array with a SlowAdapter in a
ListActivity.
setListAdapter(new SlowAdapter(this));
getListView().setOnScrollListener(this);

And an EditText with a TextChangeListener:
        dSelect.addTextChangedListener
        (
                new Tex{*filter*}cher(){
                    public void afterTextChanged(Editable s){
                    }
                    public void beforeTextChanged(CharSequence s, int start, int
count, int after){
                    }
                    public void onTextChanged(CharSequence s, int start, int 
before,
int count){
                        dStatus.setText(s.toString() + " letter writen.");
                        if (!s.toString().equals("")) {
                            for (int i = 0; i < mStrings.length; i++) {
                                if (mStrings[i].substring(0, 
1).equalsIgnoreCase(s.toString
().substring(0, 1))) {
                                    dStatus.setText(mStrings[i]);
                                    break;
                                }
                            }
                        }
                    }
                }
        );
This code works perfect, when I write something in the EditText the
corresponding value of the String array appear in the dStatus
TextView. But I want to jump in the same time to the corresponding
list item and it is should be the{*filter*}elem in the list on the screen.
I have also implemented an OnScrollListener for the ListView, so that
is work, I can scroll the list, but I can not jump to a specific list
element .
Thanks in advance for your help.

-- 

2. Take incomming calls with a click on the trackball

Hi,

Do you think it's possible to interact with an incomming call ?

I would like to create an app which autorize to take an incomming call
on trackball click.

Thank you !

-- 

3. AudioTrack channel configuration

4. maps transit layer

5. Error when an app which implements SurfaceView pass to background

6. How to release Drawable object from memory

7. Message