comparison src/com/five_ten_sg/connectbot/HelpActivity.java @ 386:e481699db6b1

wizard and help present help pages in the same order
author Carl Byington <carl@five-ten-sg.com>
date Wed, 06 Aug 2014 11:50:10 -0700
parents b12705abba3e
children 04a0316bbfe3
comparison
equal deleted inserted replaced
385:b12705abba3e 386:e481699db6b1
44 this.setTitle(String.format("%s: %s", 44 this.setTitle(String.format("%s: %s",
45 getResources().getText(R.string.app_name), 45 getResources().getText(R.string.app_name),
46 getResources().getText(R.string.title_help))); 46 getResources().getText(R.string.title_help)));
47 LinearLayout content = (LinearLayout)this.findViewById(R.id.topics); 47 LinearLayout content = (LinearLayout)this.findViewById(R.id.topics);
48 48
49 try { 49 for (final String topic : topics) {
50 String[] topics = getResources().getStringArray(R.array.list_wizard_topics); 50 Button button = new Button(this);
51 for (final String topic : topics) { 51 button.setText(topic);
52 Button button = new Button(this); 52 button.setOnClickListener(new OnClickListener() {
53 button.setText(topic); 53 public void onClick(View v) {
54 button.setOnClickListener(new OnClickListener() { 54 Intent intent = new Intent(HelpActivity.this, HelpTopicActivity.class);
55 public void onClick(View v) { 55 intent.putExtra(Intent.EXTRA_TITLE, topic);
56 Intent intent = new Intent(HelpActivity.this, HelpTopicActivity.class); 56 HelpActivity.this.startActivity(intent);
57 intent.putExtra(Intent.EXTRA_TITLE, topic); 57 }
58 HelpActivity.this.startActivity(intent); 58 });
59 } 59 content.addView(button);
60 });
61 content.addView(button);
62 }
63 }
64 catch (IOException e) {
65 // TODO Auto-generated catch block
66 Log.e(TAG, "couldn't get list of help assets", e);
67 } 60 }
68 } 61 }
69 } 62 }