Changeset 1871 for trunk/autoquest-androidmonitor/src/main/java/de/ugoe/cs/autoquest/androidmonitor/AndroidMonitor.java
- Timestamp:
- 02/03/15 12:37:19 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-androidmonitor/src/main/java/de/ugoe/cs/autoquest/androidmonitor/AndroidMonitor.java
r1842 r1871 62 62 return monitor; 63 63 } 64 65 64 66 65 /** … … 70 69 */ 71 70 public void startMonitor(Activity activity) { 72 // create logFile only once73 if (AndroidMonitor.logFile == null){71 // create logFile only once. 72 if (AndroidMonitor.logFile == null) { 74 73 AndroidMonitor.logFile = new AndroidMonitorLogFile(activity); 75 74 Log.i("logfile", "file created"); 76 75 } 77 activityName = activity.getClass().getSimpleName(); 76 activityName = activity.getClass().getSimpleName(); 78 77 addLogListenerToView(getRootView(activity)); 79 80 81 // TODO 82 // listen to changes and update own listener 83 84 // write backPresss as event to xml file 85 // activity.onBackPressed(); 86 87 // handle onStop() method of the activity 88 // add a function that end up tracking if onStop() is given otherwise 89 // create onStop() 90 // http://developer.android.com/training/basics/activity-lifecycle/stopping.html 91 } 92 public void startMonitor(View view){ 78 79 /* 80 * TODO listen to changes and update own listener. - Listen to known elements is implemented 81 * and trigger startMonitot(View). 82 */ 83 /* 84 * TODO write backPresss as event to xml file activity.onBackPressed(); 85 */ 86 /* 87 * TODO handle onStop() method of the activity add a function that end up tracking if 88 * onStop() is given otherwise. Maybe: create onStop() 89 * http://developer.android.com/training/basics/activity-lifecycle/stopping.html 90 */ 91 } 92 93 public void startMonitor(View view) { 93 94 addLogListenerToView(findFirstView(view)); 94 95 } 95 96 96 97 /** 97 98 * Get the root view of an activity. … … 149 150 if (!AndroidMonitorLogFile.isComponentLogged(view.hashCode())) { 150 151 AndroidMonitor.logFile.addComponent(view, parentHash, activityName); 152 153 Log.i("object type", ""); 151 154 152 155 // save original listener to add it later on to the groupLisatener … … 215 218 * @return the listener of the view or null if no listener exists 216 219 */ 220 // source: http://stackoverflow.com/questions/11186960/getonclicklistener-in-android-views 217 221 private View.OnClickListener getOnClickListener(View view) { 218 // http://stackoverflow.com/questions/11186960/getonclicklistener-in-android-views219 222 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { 220 223 return getOnClickListenerV14(view); … … 226 229 227 230 // Used for APIs lower than ICS (API 14) 231 // source: http://stackoverflow.com/questions/11186960/getonclicklistener-in-android-views 228 232 private View.OnClickListener getOnClickListenerV(View view) { 229 233 View.OnClickListener retrievedListener = null; … … 250 254 // Used for new ListenerInfo class structure used beginning with API 14 251 255 // (ICS) 256 // source: http://stackoverflow.com/questions/11186960/getonclicklistener-in-android-views 252 257 private View.OnClickListener getOnClickListenerV14(View view) { 253 258 View.OnClickListener retrievedListener = null; … … 283 288 } 284 289 285 286 287 290 /** 288 291 * … … 290 293 * Return the AndroidMonitorLogFile that is used in the AndroidMonitor. 291 294 * </p> 292 * 293 * @return AndroidMonitorLogFile 294 * that is used in the AndroidMonitor. 295 */ 296 public AndroidMonitorLogFile getLogFile(){ 297 return logFile; 295 * 296 * @return AndroidMonitorLogFile that is used in the AndroidMonitor. 297 */ 298 public AndroidMonitorLogFile getLogFile() { 299 return logFile; 298 300 } 299 301 }
Note: See TracChangeset
for help on using the changeset viewer.