on 09-28-2023 11:37 AM
Hi Experts,
I am using SAP BTP Android SDK, I am having a doubt please find the below scenario
I have one fragment as shown below , if i click on products it has to open products and if i click on customers it has to open the customers , both products and customers classes codes are generated from SAP BTP android wizard .Can any one please help me on this
Thanks ,
Delli
For your generated app, it should create a EntitySetListActivity, here you can find some codes which can satisfy your requirement, for example
...
listView.setOnItemClickListener listView@{ _, _, position, _ ->
val entitySetName = entitySetNameMap[adapter.getItem(position)!!]
val context = this@EntitySetListActivity
val intent: Intent = when (entitySetName) {
EntitySetName.Customers -> Intent(context, CustomersActivity::class.java)
...
EntitySetName.Products -> Intent(context, ProductsActivity::class.java)...
else -> return@listView
}
context.startActivity(intent)
}...
Actually you just invoke the below codes snips:
...
val context = this@EntitySetListActivity. // Replaced with your activity
val intent: Intent = Intent(context, CustomersActivity::class.java)
context.startActivity(intent)
...
in the OnClickListener of the button "Customers" should be enough.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
9 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.