TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Siddharth Bhardwaj
NA
2
1.6k
if-else structure not working in android?
Aug 7 2015 11:32 PM
The if else structure is not setting correct url even though location and category parameters
are correctly parsed.
private void initView(String location,String category) {
// show progress dialog
dialog = ProgressDialog.show(this, "", "Loading...");
String url;
if(location.toString()=="Jaipur" && category.toString()=="Gardner")
url = "http://192.168.186.1/apps_jaipur_gardner.php";
else if(location.toString()=="Jaipur" && category.toString()=="Mason")
url = "http://192.168.186.1/apps_jaipur_mason.php";
else if(location.toString()=="Jaipur" && category.toString()=="Carpenter")
url = "http://192.168.186.1/apps_jaipur_carpenter.php";
else if(location.toString()=="Jaipur" && category.toString()=="Plumber")
url = "http://192.168.186.1/apps_jaipur_plumber.php";
else
url = "http://sid429.hostei.com/appsonline.php";
Log.d(TAG,location);
Log.d(TAG,category);
Log.d(TAG,url);
FetchDataTask task = new FetchDataTask(this);
task.execute(url);
}
Reply
Answers (
1
)
how to compare two times in android /java
*can't save sdcard path my captured photo through this code