2013-05-17 2 views
0

간단한 메뉴 기반 앱을 만들고 있는데 의도를 구현할 때 몇 가지 문제점이 있습니다.Android ListView 및 인 텐트 관련 문제

세 가지 메뉴가 있습니다. Menu1은 Menu2에 정보를 전달해야하며 Menu2는 Menu1과 Menu2에서 Menu3으로 정보를 전달해야합니다. 이것을 위해 저는이 의미에서 인 텐트를 사용하고 있습니다.

String product = ((TextView) view).getText().toString(); 

    // Launching new Activity on selecting single List Item 
    Intent i = new Intent(getApplicationContext(), AccountList.class); 
    // sending data to new activity 
    i.putExtra("product", product); 
    startActivity(i); 

이 다음 활동 즉 AccountList 및 AccountList에 ListSelection을 통과해야는 일을하지 않고, 위의 슬프게도하지만 AccountList에서 ListSelection를 표시해야합니다 지금

TextView txtProduct = (TextView) findViewById(R.id.list_label); 

    Intent i = getIntent(); 
    // getting attached intent data 
    String product = i.getStringExtra("product"); 
    // displaying selected product name 
    txtProduct.setText(product); 

아래와 같이 SingleListItem에 동일한 전달 그래서. 당신이 제공 할 수있는 모든 도움이 크게 감사하겠습니다.

+3

getIntent 시도(). getExtras의

i.getExtras().getString("product");

를 호출하십시오.에는 getString ("제품") –

답변

0

) (대신

i.getStringExtra("product");

+0

여전히 작동하지만 때하지 않았다 I 작업 한 프로젝트를 실행하러 갔다 !!! –