Thursday, May 20, 2010

Android : startActivityForResult() Example

Hi,
Here is the code for startActivityForResult() method, I think it will help you to understand this method’s utility
to return the value from called Activity to calling activity.
Calling Activity
 package com.example.checkforresult;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;

public class CheckStartActivityForResult extends Activity {
int requestCode;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
Log.d("CheckStartActivity","OnCreate");
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent i = new Intent(this,CalledActivity.class);
startActivityForResult(i, requestCode);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.d("CheckStartActivity","onActivityResult and resultCode = "+resultCode);
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
if(resultCode==1){
Toast.makeText(this, "Pass", Toast.LENGTH_LONG).show();
}
else{
Toast.makeText(this, "Fail", Toast.LENGTH_LONG).show();
}
}
}
Called Activity
package com.example.checkforresult;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

public class CalledActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
        Log.d("CalledActivity","OnCreate ");
       //String value = "rahul";
        Intent in = new Intent();
        setResult(1,in);//Here I am Setting the Requestcode 1, you can put according to your requirement
        finish();
}

And Please both services in your manifest file.  

Friday, April 30, 2010

Unable to set current music track as status in Gtalk



If you are facing difficulty in setting your current music track as status message, here are simple steps to make it work
Step 1. Uninstall your Gtalk.
Step 2. Exit Windows Media Player( it is mandatory), otherwise changes will not be reflected.
Step 3. Download latest version of Gtalk.
Step 4. Right click on your installer and click on "Run As Administrator".

It will work fine.

Monday, April 26, 2010

Few more sites for movies download

Hi guys,

here are few new links I got through net.
1. http://www.moviesmobile.net/bollywood-mobile-movies/new.php
2. http://free-moviedownloads.net/

Monday, March 29, 2010

Android : Conversion to Dalvik format failed with error 1

If you are facing the Conversion to Dalvik format failed with error 1 error, then it is generally removed by cleaning the project, so just do Project->Clean. And sometimes it is also caused if you are using external jars, so if you are getting Conversion to Dalvik format failed with error 1 error, make sure there is no external jars.

Unable to resolve target 'Google Inc.:Google APIs:3'

Hi guys,
If you are facing the ”Unable to resolve target ‘Google Inc.:Google APIs:3′” problem, then what you should try is just open the default.properties file in the project folder and modify the target asandroid-3. This is also applicable for API version also.

Saturday, March 6, 2010

Bangalore to Mangalore

Hi guys,
yesterday I traveled to Mangalore from Bangalore and I think this was worst journey in my life till date. I dont know why karnataka government didn't invested in the road infrastructure. In shhort i would suggest please use train instead of buses. Be careful,as there may be so many distortions in your body after traveling through that road.

Thursday, December 24, 2009

Bsnl Broadband Type 2 modem Setting

Hi,
If you want to configure your type II modem, for multiple system, then here is the solution, first follow the steps defined in the following link
http://www.calcuttatelephones.com/dataoneinstall/mu08.html

Now open the http://192.168.1.1 and there open WAN settings, now select PPPoE service, if it is there then delete and create it again, now choose the default option, in the intermediate step it will ask for username password, enter the details, reboot it.
Hope it will help.



P.S Take care the security measure.