Categories
Mastering Development

Making a simple clickable list in Android X using Kotlin and SQLite (Android Studio 4.1)

I’m coming from Android Java and I’ve used ListView earlier. Now I’m trying to create a simple list in Android X Kotlin using androidx.recyclerview.widget.RecyclerView. My app is working, but I’m unsure how to implement the onclick listener for items. My app have the following: DatabaseHelper : Creates a table "categories" and inserts some categories IdTitleDataClass […]

Categories
Mastering Development

How can i go to an other activity when i click button of list view?

I want to Intent two different activity(FreeLine, MoveCircle) if i click that start button it will always start FreeLine How to separate these intents..? @Override public View getView(final int position, View convertView, ViewGroup parent) { final Context context = parent.getContext(); if (convertView == null) { LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = mInflater.inflate(mLayout, parent, false); } […]

Categories
Mastering Development

Grid reusable recycler view not displaying in view pager

I have a recycler view which I am reusing along with a fragment being shared by two screens in a view pager, with a tab layout on top. The recycler view will display a vertical list on the first tab, and a grid on the second tab. The list is rendered fine for the first […]

Categories
Mastering Development

recyclerview show last item on click an item intent

I am making a recycler view to display SQLite data including 1blob, and integer primary key autoincrement, and 3string values with card views inside recycler view. I’ve put the edit button in the card view so that the user can click the edit button and edit the details of that SQLite row. This is my […]

Categories
Mastering Development

Android Studio searchview with recyclerview

Hi im learning android studio and i cant get to work my SEARCH VIEW can u help me please my app crashs and says java.lang.IndexOutOfBoundsException: Invalid index 1, size is 1 MAIN LIST WITH RECYCLER VIEW ITEMS public class list_product extends AppCompatActivity implements SearchView.OnQueryTextListener { RecyclerView recyclerView; SearchView searchView; MyDatabaseHelper myDB; ArrayList<String> id_id,id_cliente, id_cantceldas; CustomAdapter […]

Categories
CMS Joomla Mastering Development

Own Custom Field Plugin – Multiple Inputs

I am currently creating a custom field plugin for Joomla! I am now faced with the task / problem that the user needs more than just one field when adding the information. In detail it is so that it is a map plugin and the user can enter the coordinates in a field and set […]

Categories
Mastering Development

Android: ViewModel with paging 3 flow is leaking

My problem is, that my shopViewModel which holds an instance of a paging-flow is somehow leaking. I’ve tried to solve this problem by converting the flow into a livedata, but that changed nothing. ViewModel class ShopViewModel @ViewModelInject constructor( private val shopPagingSource: ShopPagingSource, ) : ViewModel() { val SHOP_PAGE_CONFIG: PagingConfig = PagingConfig(pageSize = 20, enablePlaceholders = […]

Categories
Mastering Development

How to focus/scroll to a specific item in recyclerView by fetching item position

I have to scroll to a specific item in a recyclerview. Firstly I need to fetch the position of the item by matching with a string which I pass from the activity to the adapter. then to focus to that item position. For example in the adapter there is a TextView which has EventID stored, […]

Categories
Mastering Development

Can’t setOnItemClickListener ListView Kotlin

I have implemented a custom adapter in a ListView but when i try to use setOnItemClickListener the function does not work. I tried using a toast to notify me if the click respond but it did not work Here is my activity and the adapter class PasswordListActivity : AppCompatActivity() { private lateinit var dataSource: SavedPasswordDB […]

Categories
Mastering Development

Can’t view single user data from firebase using recyclerview

I am trying to display a single user "email" and "username" data from firebase after login. At present, my app crashes when I login and logcat shows this error: Can’t convert object of type java.lang.String to type com.example.start.model Note: I am pushing username from the login page using intent.putExtra() My database snapshot: database snapshot Main […]