2011-08-11 5 views
2

사이트에서 자습서를 따라 응용 프로그램에 RSS 파서를 설치했습니다. 이제 독자는 멋지게 보입니다. 그러나 링크를 클릭하면 웹 뷰 활동에서 URL이 열리도록 프로그램하고 싶습니다. 이것이 가능한가? RSS 피드가 독자에게 표시되도록하는 코드를 게시합니다.Webview 활동에서 RSS 링크 열기

public class MessageList extends ListActivity { 

private List<Message> messages; 

@Override 
public void onCreate(Bundle icicle) { 
    super.onCreate(icicle); 
    setContentView(R.layout.rss); 
    loadFeed(); 
} 

;

private void loadFeed(){ 
    try{ 
     BaseFeedParser parser = new BaseFeedParser(); 
     messages = parser.parse(); 
     List<String> titles = new ArrayList<String>(messages.size()); 
     for (Message msg : messages){ 
      titles.add(msg.getTitle()); 
     } 
     ArrayAdapter<String> adapter = 
      new ArrayAdapter<String>(this, R.layout.row,titles); 
     this.setListAdapter(adapter); 
    } catch (Throwable t){ 
     Log.e("IML News",t.getMessage(),t); 
    } 
} 

} 모든

답변

0

먼저이 보라 :

http://developer.android.com/reference/android/text/style/ClickableSpan.html 그럼 내가 당신에게 튜토리얼을 발견 : http://www.androidengineer.com/2010/08/easy-method-for-formatting-android.html

이 그것을 읽고 당신이 포맷하는 방법을 배우게됩니다 당신의 textviews의 텍스트는 Html과 같습니다. 클릭 가능한 링크를 만들 수 있습니다.

링크를 클릭하면 일반적으로 웹보기가 열립니다.

+1

어떻게 이것이 나를 도와 줄지 잘 모르겠습니까? RSS 링크가 목록보기 안에 있다는 것을 잊어 버렸습니다. – Derok8

+1

해결책을 찾았습니다. 나중에 참조 할 수 있도록 코드를 게시 할 것입니다. – Derok8

+0

코드를 게시 할 기회가 있습니까? –