I have class Key that extends View and put objects of this class on layout. Key is key of piano and when it's pressed, it should change image to presses key. For this aim it has methods press() that change state, play note and calls invalidate() method and release() that change state and also calls invalidate() method. I want to play programatically sounds and create object of class Recorder where I put in ArrayList references to keys that will be presses. Meanwhile I create ArrayList durations with time delay before the next note. It plays well my melody, but it does not redraw keys and locks method onDraw() that I overrode. I want to show how keys play sequentially. How to fix it? I tried to run any threads like runOnUiThread for playing this melody and nothing is going.
Invalidate programmatically piano keys on android
250 Views Asked by Arslan At
1
There are 1 best solutions below
Related Questions in ANDROID
- Creating global Class holder
- Flutter + Dart: Editing name of a tab shows up a black screen
- android-pdf-viewer Received status code 401 from server: Unauthorized
- Sdk 34 WRITE_EXTERNAL_STORAGE not working
- ussd reader in Recket Native module
- Incorrect display of LinearGradientBrush in IOS
- The Binary Version Of its metadata is 1.8.0, expected Version is 1.6.0 build error
- I can't make TextInput to auto expand properly in Android
- Creating multiple instances of a class with different initializing values in Flutter
- How to create a lottie animation
- making android analyze with coverity sast tool
- Flutter plugin development android src not opening after opening example
- I initialize my ViewModel in the Activity with several fragments as tabs, but the fragments(tabs) return null for the updated livedata
- Node.js Server + Socket.IO + Android Mobile Applicatoin XHR Polling Error...?
- How I can use the shared preferences class?
Related Questions in VIEW
- Opening sheet in SwiftUI view
- Get json field value in sqlite model from view django
- I don't understand which databases are invalid
- View is not refreshing
- Changes to my model/viewmodel are not charging what's on my view
- How to create a text sticker view in swift, like in Canva App, which is resizable as per the text content in it
- SQL Tranformations in view or stored procedure?
- SQL query getting too slowly when using IIF in a view column that is using aggregate results from a previous view. see below example for a clarity
- How to add focus in AndroidView field
- Angular 17 does not update view using setInterval with NG0500 error in console
- How to use std::ranges::set_symmetric_difference over a non sorted range?
- AUTH_USER_MODEL refers to model 'Socialmedia.User' that has not been installed
- Is it possible to show columns really used in a view
- Can't render views of html in django
- Entity Framework Core add relationship between view and standard model objects
Related Questions in INVALIDATION
- How to handle leftover session data when implementing session and cookie-based login and logout?
- Unable to run backtesting.py on Jupyter Notebook
- RTK Query - Custom Tag-Invalidation Request to use tag invalidation with merge
- UnpicklingError: invalid load key, 'A'
- How to invalidate a particular key & data for Loading cache taking a key and data as Mono of List of String
- Unsual working of Date() method in Javascript
- Hazelcast Near Cache Not Invalidating After 60 Seconds as Configured
- Label Text UserControl Not updateing
- The difference between dcbf and dccivac arm instructions
- Invalidate all queries but refetch only active
- Cache aside strategy : delete or update the cache after the write?
- Timer can not find in scope
- AWS Cloudfront giving 503 after invalidating s3 origin
- How to invalidate whole cache for Apollo GraphQL (not for one specific query) onclick
- How Postgres avoid "iteration invalidation" and you can loop over rows and modify the data at the same time?
Related Questions in PIANO
- Getting an error "_kwargs = spec_.kwargs.copy()" saying "AttributeError: 'NoneType' object has no attribute 'copy'" when running tensor2tensor
- Piano keys to key stroke conversion
- there's no way to use dart3 incompatible package?
- How can I stop my variables working, and make them work only when I want them to?
- How do I access two hidden controls on Kontakt Player running Blüthner Model One (virtual piano)?
- Overlapping buttons in Xamarin.Forms grid
- Why specifying a class in CSS breaks my code?
- Draw piano keys in GTKsharp
- How to make a button execute when we swipe over it ? (In android studio)
- Arduino - Measuring the time interval between one button press and release - Add Velocity to MIDI Keyboard
- Return Type Format of Python pygame.midi.Input.read()
- FFT What are the other frequencies when a single piano note is played
- How to implement a MIDI keyboard into python
- Is there a good way to make Piano Graphics in Java?
- Recognize start of piano music in an MP3 file which starts with a spoken introduction, and remove spoken part, using Python
Related Questions in ANDROID-RUNONUITHREAD
- runOnUIThread throwing error and crashing app
- Why mapBox runs without any error but with same codes the carto-Map gives "Animators may only be run on Looper threads"
- Changing Button Color on MainActivity via RunOnUIThread Crashes
- Capture Images and show in RecyclerView : Too much work on the main thread
- Issue in rendering items in the main thread from a worker thread
- Response error okhttp3. runOnUiThread/Thread
- runOnUIThread on android is unable to setfocus on the EditText and show soft keyboard
- Which Android API classes must have their methods runOnUiThread?
- runOnUIThread for Android is hiding the soft keyboard
- Getting 'Unresolved reference' for 'runOnUiThread'
- is there any difference between runOnUiThread and CoroutineScope(Dispatchers.Main) in Kotlin Android
- android Dialog Dismiss -> Only the original thread that created a view hierarchy can touch its views. when I using runOnUiThread
- How to pass data that changes real-time from activity to fragment?
- nullPointerException on calling getActivity().runOnUiThread{new Runnable inside Fragment
- Function being called twice in runOnUiThread Android Studio java
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
OK. I solved this problem. For every key I create an instance of class that extends AsyncTask and override doInBackground() method.