Question: I have a site with urls:

```
http://example.com/controller-name/page/about
http://example.com/controller-name/page/contactus
http://example.com/controller-name/page/services

```

But I need the urls like:

```
http://example.com/controller-name/about
http://example.com/controller-name/contactus
http://example.com/controller-name/services

```

How to do this in `Codeigniter`?

Answer: 
Please add your 
 //execute background task

```
   BackTask bt=new BackTask();
   bt.execute();

```

in `onCreate()` **instead** on `onStart()`;

For more understanding please have a look at 

[http://developer.android.com/training/basics/activity-lifecycle/index.html](http://developer.android.com/training/basics/activity-lifecycle/index.html "Developer Site")

**EDIT**

```
protected void onCreate(Bundle savedInstanceState) {
   //TODO Auto-generated method stub
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_main);
   context=this;
   records=new ArrayList<String>();
   listProduct=(ListView)findViewById(R.id.product_list);

 BackTask bt=new BackTask();
       bt.execute();

   adapter=new CustomAdapter(context, R.layout.list_item,R.id.pro_name, records);
   listProduct.setAdapter(adapter);
   listProduct.setOnItemClickListener(new OnItemClickListener(){
       @Override
       public void onItemClick(AdapterView<?> arg0, View v, int position, long id){

           String sText = ((TextView) v.findViewById(R.id.pro_name)).getText().toString();
           Intent songIntent = new Intent(getApplicationContext(), SongActivity.class);
           songIntent.putExtra("movie_name", sText );
           startActivity(songIntent);

       }

   });
   }

```
One way to make your activities respond better when you're checking for data remotely would be to cache data using onSaveInstanceState() and saving the record list in a bundle from which you can read during the onCreate() of your activity.

As just in case if the system decides to zap your activity from the stack then it'll try to load the data again from remote host (which could take a while). 

Also yes you should execute the AsyncTask in onCreate() instead of onStart() and be sure to remove duplicates from your records list when fetching the data from your server.