Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Android
Instagram error
sasa anali
Ranch Hand
Posts: 30
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I took this code but I think I'm messing ) .. I tried it at the end but still an error, does anybody know?
package com.example.a; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.widget.Button; import android.view.View; import android.view.View.OnClickListener; public class MainActivity extends Activity { Button dadclink; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); addListenerOnButton(); } public void addListenerOnButton() { dadclink = (Button) findViewById(R.id.dadclink); dadclink.setOnClickListener(new OnClickListener() { @Override public static Intent newInstagramProfileIntent(PackageManager pm, String url) { Intent intent = new Intent(Intent.ACTION_VIEW); try { if (pm.getPackageInfo("com.instagram.android", 0) != null) { if (url.endsWith("/")) { url = url.substring(0, url.length() - 1); } String natgeo = url.substring(url.lastIndexOf("/") + 1); intent.setData(Uri.parse("http://instagram.com/_u/" + natgeo)); intent.setPackage("com.instagram.android"); return intent; } } catch (NameNotFoundException e) { } intent.setData(Uri.parse(url)); return intent; }} } };
Bear Bibeault
Sheriff
Posts: 67746
173
I like...
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Please
TellTheDetails
. What error?
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Ulf Dittmer
Rancher
Posts: 43081
77
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Post the full stack trace from the logcat.
sasa anali
Ranch Hand
Posts: 30
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Bear Bibeault: It just the ) that I tried it at the end..
Ulf Dittmer: Running it gives me an error, nothing on the LogCat
Ulf Dittmer
Rancher
Posts: 43081
77
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
What is "an error"? As Bear said, TellTheDetails. What are the inputs, what are the outputs, what happens if you run the code, and how is that different from what you expected?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Missed a } and/or ) on if/else
Fourth link
error in USSD code in android
New to Android Programing
The Toast msg doesn't show
More...