how to call Async task with in period of time
<p>I want to fetch audio metadata periodically like song name and artist name.
for that i am using media metadata retriever in Async-task.
So problems are</p>

<p>1) In AsyncTask class how can i assign text to Taxt-view.</p>

<p>2) How can i call that Async-task class within a specific time, like 30sec time interval.</p>

<p>3) There are some text which i need to fetch only once in a day. so how can check that when last time data was fetched? and also which is the best method to store that fetch data and use it to Listview?(i mean i need to store that that into database or any hashmap or array list?) </p>

<p>Here is metadata retriver code</p>

<pre><code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    return inflater.inflate(R.layout.afragment, container, false);
}

@Override
public void onStart() {
    super.onStart();
    initfrag();
}

private void initfrag() {
    // TODO Auto-generated method stub
    lv1=(ListView)getView().findViewById(R.id.list);

    tv=(TextView)getView().findViewById(R.id.tv1);
    tv1=(TextView)getView().findViewById(R.id.tv2);
    LongOperation task=new LongOperation();
    task.execute();
}

class LongOperation extends AsyncTask&lt;String, Void, String&gt; {
    @Override
    protected String doInBackground(String... params) {
        MediaMetadataRetriever metaRetriever = new MediaMetadataRetriever();
        String link = "http://xyz-radio-link.ogg";
        metaRetriever.setDataSource(link, new HashMap&lt;String, String&gt;());
        // get mp3 info
        title = metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_TITLE);
        artist = metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ARTIST);
        metaRetriever.release();  
        refreshtext();
        return null;
    }      
    @Override
    protected void onPostExecute(String result) {               
    }
    @Override
    protected void onPreExecute() {
    }
    @Override
    protected void onProgressUpdate(Void... values) {       
    }
}

public void refreshtext() {
    // TODO Auto-generated method stub
    Typeface tf = Typeface.createFromAsset(getActivity().getAssets(),"fonts/Roboto-Regular.ttf");
    tv.setTypeface(tf);
    tv1.setTypeface(tf);
    tv.setText(artist);
    tv1.setText(title);
}
</code></pre>
