You are viewing our Forum Archives. To view or take place in current topics click here.
Complex Android Programming
Posted:

Complex Android ProgrammingPosted:

PolishModzCreator
  • Ladder Climber
Status: Offline
Joined: Jun 18, 201211Year Member
Posts: 387
Reputation Power: 15
Status: Offline
Joined: Jun 18, 201211Year Member
Posts: 387
Reputation Power: 15
I am making an app for android in c#. Its pretty easy, but I am running into a problem with a button. Ideally, when I tap the button I want it to open my contacts, so I try this code

var button1 = FindViewById<Button> (Resource.Id.button1);
         button1.Click += delegate {
            var intent2 = new Intent ("com.android.contacts");
            StartActivity(intent2);


         };

When I press the button the app closes. Help?
#2. Posted:
GameDev14
  • Junior Member
Status: Offline
Joined: Jan 10, 201410Year Member
Posts: 80
Reputation Power: 3
Status: Offline
Joined: Jan 10, 201410Year Member
Posts: 80
Reputation Power: 3
Are you talking about contacts on the phone or contacts on the app? If its the phone contacts you will need to add a manifest permission to read the users contacts,

I'm pretty sure its along the lines of
<uses-permission android:name="android.permission.READ_CONTACTS"></uses-permission>
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.