Skip to content

Commit 790d8b3

Browse files
committed
feat: log VIEW_ITEM event in MainActivity
- Implemented logging of VIEW_ITEM standard event using BranchEvent when the report view button is clicked. - Added user confirmation via Toast message to indicate successful event logging. - Removed unnecessary blank lines for improved code clarity.
1 parent 08ecbcf commit 790d8b3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Branch-SDK-TestBed/src/main/java/io/branch/branchandroidtestbed/MainActivity.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ public void onClick(View v) {
150150
String currentUserId = PrefHelper.getInstance(MainActivity.this).getIdentity();
151151
Branch.init().logout();
152152
Toast.makeText(getApplicationContext(), "Cleared User ID: " + currentUserId, Toast.LENGTH_LONG).show();
153-
154153
}
155154
});
156155

@@ -225,8 +224,10 @@ public void onLinkCreate(String url, BranchError error) {
225224
findViewById(R.id.report_view_btn).setOnClickListener(new OnClickListener() {
226225
@Override
227226
public void onClick(View v) {
228-
229-
// List on google search
227+
BranchEvent viewItemEvent = new BranchEvent(BRANCH_STANDARD_EVENT.VIEW_ITEM);
228+
viewItemEvent.logEvent(MainActivity.this);
229+
230+
Toast.makeText(MainActivity.this, "VIEW_ITEM event logged", Toast.LENGTH_SHORT).show();
230231
}
231232
});
232233

0 commit comments

Comments
 (0)