Search Results

Search found 5 results on 1 pages for 'ng93'.

Page 1/1 | 1 

  • how to use intent from receiver android

    - by ng93
    hi ive got a working sms receiver but when i try to load another class using: Intent intent = new Intent(SMSReceiver.this, SMSNotifier.class); startActivityForResult(intent, 0); i get the error: The constructor Intent(SMSReceiver, Class<SMSNotifier>) is undefined for the first line and: The method startActivityForResult(Intent, int) is undefined for the type SMSReceiver for the second line id really appreciate some advice as to whats going wrong thanks, ng93

    Read the article

  • get contact info from android contact picker

    - by ng93
    hi im trying to call the contact picker, get the persons name, phone and e-mail into strings and send them to another activity using an intent. So far this works Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI); startActivityForResult(intent, 1); @Override public void onActivityResult(int reqCode, int resultCode, Intent data) { super.onActivityResult(reqCode, resultCode, data); if (resultCode == Activity.RESULT_OK) { Uri contactData = data.getData(); Cursor c = managedQuery(contactData, null, null, null, null); if (c.moveToFirst()) { String name = c.getString(c.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME)); Intent intent = new Intent(CurrentActivity.this, NewActivity.class); intent.putExtra("name", name); startActivityForResult(intent, 0); } } } but if i add in: String number = c.getString(c.getColumnIndexOrThrow(ContactsContract.CommonDataKinds.Phone.NUMBER)); it force closes maybe theres another way to get their number? thanks for help, ng93

    Read the article

  • android get contact phone number

    - by ng93
    hi, im trying to get a contacts name and phone number from the contacts list. im using: contactname = Curser.getString(Curser.getColumnIndex(Contacts.DISPLAY_NAME)); to get their name and it works fine. But using: contactphone = Curser.getString(Curser.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)); causes no warnings or errors and builds fine, yet force closes in both the emulator (2.1) and my htc desire (nexus one 2.2 rom/htc desire 2.1 rom). Any ideas how to fix it? oh and contactname and contactphone are both strings thanks, ng93

    Read the article

  • android searchable not opening

    - by ng93
    Hi im trying to use a searchable activity in my application but when the search button is pressed nothing happens AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.test.test" android:versionCode="1" android:versionName="1.0.0" android:configChanges="keyboardHidden|orientation"> <uses-sdk android:minSdkVersion="7"/> <application android:icon="@drawable/icon" android:label="Test"> <activity android:name=".Test" android:label="Test" android:debuggable="true" android:theme="@android:style/Theme.NoTitleBar" android:launchMode="singleTask"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <activity android:name=".Searchable"> <intent-filter> <action android:name="android.intent.action.SEARCH" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <meta-data android:name="android.app.searchable" android:resource="@xml/searchable"/> </activity> <meta-data android:name="android.app.default_searchable" android:value=".Searchable"/> </application> </manifest> Searchable.xml (res/xml/searchable.xml) <?xml version="1.0" encoding="utf-8"?> <searchable xmlns:android="http://schemas.android.com/apk/res/android" android:label="Search" android:hint="Perform Search"> </searchable> Searchable.java (src/com/test/test/Searchable.java) package com.test.test; import android.app.Activity; import android.app.SearchManager; import android.content.Intent; import android.os.Bundle; public class Searchable extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); handleIntent(getIntent()); } @Override protected void onNewIntent(Intent intent) { setIntent(intent); handleIntent(intent); } private void handleIntent(Intent intent) { if (Intent.ACTION_SEARCH.equals(intent.getAction())) { String query = intent.getStringExtra(SearchManager.QUERY); } } } TIA, ng93

    Read the article

1