Saturday, 31 August 2013

Sending message to specific Number(Whatsapp)

Sending message to specific Number(Whatsapp)

I've tried this it seems to be working for everyone but not for me. If you
want to extra information inform me and i'll add it.
My Code:
import android.net.Uri;
import android.os.Bundle;
import android.provider.Contacts;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.database.Cursor;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import com.actionbarsherlock.ActionBarSherlock;
import com.actionbarsherlock.ActionBarSherlock.OnCreateOptionsMenuListener;
import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.view.MenuInflater;
public class MainActivity extends SherlockActivity {
I get The method getSherlockActivity() is undefined for the type new
View.OnClickListener(){} From this code:
Cursor c =
getSherlockActivity().getContentResolver().query(ContactsContract.Data.CONTENT_URI,
new String[] { ContactsContract.Contacts.Data._ID },
ContactsContract.Data.DATA1 + "=?",
new String[] { "96XXXXXXX@s.whatsapp.net" }, null);
c.moveToFirst();
Intent i = new Intent(Intent.ACTION_VIEW,
Uri.parse("content://com.android.contacts/data/" +
c.getString(0)));
startActivity(i);
c.close();
Thanks in advance.

No comments:

Post a Comment