Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 3 Jahren, 2 Monaten
Letzter Beitrag:
vor 3 Jahren, 2 Monaten
Beteiligte Autoren:
Piotr J, Neptunia1, Neptinia

WM19 Open Contacts List

Startbeitrag von Neptinia am 18.04.2015 17:10

Hello,

I search on the net before my question ... and .... i don't find the solution.
I want open the contacts list system.

So, i use " startActivityForResult "
I try everythings ... but no one get a result
Please ... help me !! ='( ...

Thanks
Kiss
Alexandra.

My last code using ...

Quote

import android.app.Activity;
import android.content.Intent;
import android.content.Context;
import android.provider.Settings;
import android.provider.ContactsContract;
import android.provider.Contacts;
import android.net.Uri;
import android.database.Cursor;
import android.content.ContentResolver;
import android.view.View;
import android.widget.Toast;


public static class OuvertureContactClass extends Activity
{

private final int PICK_CONTACT_REQUEST = 1; // The request code

public OuvertureContactClass(Context context, Intent intent){
Toast.makeText(context, "test 123", Toast.LENGTH_LONG).show();
Intent pickContactIntent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
pickContactIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivityForResult(pickContactIntent, PICK_CONTACT_REQUEST);
}

@Override
protected void onActivityResult(int reqCode, int resultCode, Intent data) {
onActivityResult(reqCode, resultCode, data);
Context context = getApplicationContext();
// Check which request we're responding to
if (reqCode == PICK_CONTACT_REQUEST) {
// Make sure the request was successful
if (resultCode == Activity.RESULT_OK) {
Uri contactData = data.getData();
Cursor c = context.getContentResolver().query(contactData, null, null, null, null);
if(c.moveToFirst()) {
String name = c.getString(c.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME));
appelProcedureWL("Ouverture_Contact_reponse",name);
}
}
}
}

}



and

Quote

import android.app.Activity;
import android.content.Intent;
import android.content.Context;
import android.provider.Settings;
import android.provider.ContactsContract;
import android.provider.Contacts;
import android.net.Uri;
import android.database.Cursor;
import android.content.ContentResolver;
import android.view.View;
import android.widget.Toast;

public static void test()
{

// Retrieve the current Context
Context tmpContext = getApplicationContext();
Intent myIntent = new Intent(tmpContext,OuvertureContactClass.class);
myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
tmpContext.startActivity(myIntent);
Toast.makeText(tmpContext, "1", Toast.LENGTH_LONG).show();
}

Antworten:

Please ... if you want, i pay for your help ! But i need the solution.
Thanks
Kiss
Alexandra

von Neptinia - am 18.04.2015 19:50
Hi,

Have a look here:
http://eclipsed4utoo.com/blog/android-open-contacts-activity-return-chosen-contact/

Regards
Piotr

von Piotr J - am 18.04.2015 21:59
Thanks for you answer Piotr :)

I see this website, but ... and i try to use it, but, i can't write all public void in windev procedure = error message appear.

Can you help me ? If you want, i pay for your help !

Thks :)
Alexandra

von Neptunia1 - am 19.04.2015 12:26
Hi Alexandra,

Also , have you tried the 'Android - Managing Contacts' example that comes with WM19 ? That has the Contact List in there too, would probably be an easier option?

Regards

Piotr

von Piotr J - am 19.04.2015 16:02
Hello :)

Thank you for your answer :)

Umm no ... I try to use this example but ,
My project is to import all contacts with their group.

If you use this example, you get contact without group ... and you get ALL CONTACTS ! (Skype, mail address frequently (gmail)...)

Thanks for your help :)

von Neptunia1 - am 19.04.2015 17:35
Ah, ok.

Have your tried filtering the Contact List with the ContactListSource function, so you can choose only the contacts you want, for example, email ones?

Cheers

Piotr

von Piotr J - am 19.04.2015 18:18
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.