How to solve duplicate classes code?



I am having a problem with a code that I created. I have two classes that uses the same code. The only thing I change was the name of the class and the activity. For example,



Class Activity
A.java A.xml
B.java B.xml


I copy and past both class and activity. The problem I am experiencing is that A.java works but B.java is not working. A.java uses a database and populate a listview when is called. If a user wants to search it will display the results accordingly to the critiria. B.java should do the same but the problem is that it doesnt search. It returns 0 results from the database. Like I said, it uses the same code. I have not change anything from A to B. I dont understand why B is not working while A it is. The only good thing is that B populates the listview when is called but not when it searches.


No comments:

Post a Comment