나는 하나의 안드로이드 응용 프로그램을 개발했습니다.자바에서 URL에 문자열 값을 호출
여기에 url.please에 문자열 값을 전달해야합니다. 어떻게 문자열 값을 url.give로 전달할 수 있습니까? [http://api1.sfsfsfsff.com/dev/categories/?fields= & 카테고리 ID = 10 & access_token은 = bfb787a6e1112] [1]
내가 언급 한 :
String mTitle;
String URL = "http://api1.sfsfsfffsf.com/dev/categories/?fields=&categoryid="+mTitle+"&access_token=bfb787a6e1";
static String KEY_CATEGORY = "category";
// public static final String URL_Address=null;
static final String KEY_TITLE = "categoryName";
static final String KEY_NAME ="categoryId";
static final String KEY_SUBCATE = "categoryId";
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.subcate);
Bundle b = getIntent().getExtras();
mTitle = b.getString(KEY_SUBCATE);
TextView grandtotal = (TextView) findViewById(R.id.subcate);
grandtotal.setText("Welcome ," + mTitle);
이
내 URL입니다 직접 categoryid = 10 의미는 모든 제품을 disaplyed 의미합니다. [http://api1.sfsfsfsfsf.com/dev/categories/?fields= & 카테고리 ID = "+ mTitle +"& access_token은 = bfb787a6e1112] [2] :는하지만 내가 좋아하는이 URL을 변경해야
Nw 나는 내 URL을 으로 변경했습니다. categoryid = "+ mTitle +"은 모든 제품을 표시하지는 않습니다.
mTitle 값이 이전 활동에서 비롯되었습니다.
내 코드에 무슨 문제가 있습니까?
편집 :
내 mTitle 값이 10.i이 수단
grandtotal.setText ("환영"+ mTitle)과 같은 코드를 작성해야한다;
표시된 mTitle 값이 성공적으로 표시됩니다.
grandtotal.setText ("Welcome,"+ URL);
수단이 나에게 문자열로 URL을 전달 null 값
그냥 내 mTitle 값이 무엇인지 확인하십시오 – Suranga
내 mTitle 값은 10.i와 같은 코드를 작성해야합니다. grandtotal.setText ("Welcome,"+ mTitle); 표시된 mTitle 값 successfully.grandtotal.setText ("Welcome,"+ URL); 의미는 나에게 null 값을주었습니다 – user1897014