|
| Iniciado por guest, 18,abr. 2015 19:10 - 6 respuestas |
| |
| | | |
|
| |
| Publicado el 18,abril 2015 - 19: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();
} |
| |
| |
| | | |
|
| | |
| |
| Publicado el 18,abril 2015 - 21:50 |
Please ... if you want, i pay for your help ! But i need the solution. Thanks Kiss Alexandra |
| |
| |
| | | |
|
| | |
| |
| Publicado el 18,abril 2015 - 23:59 |
Hi,
Have a look here: <a class="ExternalLink" rel="nofollow" target="_blank" href="http://eclipsed4utoo.com/blog/android-open-contacts-activity-return-chosen-contact/">http://eclipsed4utoo.com/blog/android-open-contacts-activity-return-chosen-contact/</a>
Regards Piotr |
| |
| |
| | | |
|
| | |
| |
| Publicado el 19,abril 2015 - 14:26 |
Thanks for you answer Piotr <img src="/NG2013_WEB/ui/smiley/1.gif" align=absmiddle border=0 alt=":)">
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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 19,abril 2015 - 18:02 |
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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 19,abril 2015 - 19:35 |
Hello <img src="/NG2013_WEB/ui/smiley/1.gif" align=absmiddle border=0 alt=":)">
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  |
| |
| |
| | | |
|
| | |
| |
| Publicado el 19,abril 2015 - 20:18 |
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 |
| |
| |
| | | |
|
| | | | |
| | |
|