I want to have my main class for creating activity for 2 different flags.
1) One with relative layout Textview and images for which I am extend开发者_如何学JAVAing my class as
public class Abcd extends Activity implements View.OnClickListener, _
AdapterView.OnItemClickListener, ViewFactory{
2) secondly with linear layout as to have a textview imageview and list.
now for the second case I want to use preferencescreen instead of list, for which I have to extend my activity from PreferenceActivity .
Need your suggestion if I can do so.
Thanks Vani
VB does not support it, neither does C#.
This is referred to as Polymorphism and there's plenty of information available if you search for that word.
Generally you would want polymorphism because you want to attach two types of behavior to the class - you can achieve this just as easily by using composition over inheritance - again there is plenty of advice available if you search for that term.
精彩评论