Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. // Create the layout to be placed inside the ScrollView
  2. LinearLayout layout = new LinearLayout(mActivity);
  3.  
  4. // Makes each object stack vertically instead of horizontally
  5. layout.setOrientation(LinearLayout.VERTICAL);
  6.  
  7. // Create actual images/text to display
  8. ImageView iv = new ImageView(mActivity);
  9. iv.setImageBitmap(monsterBitmap);
  10. TextView tv = new TextView(mActivity);
  11. tv.setText(credits);
  12.  
  13. // Add images/text to LinearLayout
  14. layout.addView(iv);
  15. layout.addView(tv);
  16.  
  17. // Create the ScrollView and set the scrollable area size
  18. ScrollView about = new ScrollView(mActivity);
  19. about.setLayoutParams(new ViewGroup.LayoutParams(320, 430));
  20.  
  21. // Add LinearLayout to the ScrollView
  22. about.addView(layout);
  23.  
  24. // Get reference to the FrameLayout and add the ScrollView
  25. FrameLayout fl = (FrameLayout)mActivity.findViewById(R.id.framelayout);
  26. fl.addView(about);
  27.  
  28.  
  29.  
  30.