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
- Delay in loading Html Page(WebView) from assets folder in real android device
- MPAndroidChart method setWordWrapEnabled() not found
- Designing a 'new post' android activity
- Android :EditText inside ListView always update first item in the listview
- Android: Transferring Data via ContentIntent
- Wrong xml being inflated android
- AsyncTask Class
- Unable to receive extras in Android Intent
- Website zoomed out on Android default browser
- Square FloatingActionButton with Android Design Library
- Google Maps API Re-size
- Push toolbar content below statusbar
- Android FragmentPagerAdapter Circular listview
- Layout not shifting up when keyboard is open
- auDIO_OUTPUT_FLAG_FAST denied by client can't connect to localhost
Related Questions in VIEW
- Serve arbitrary html in angular data bind
- Switching CSS Just for that view?
- Setting % of a background color programmatically
- Change the View BackgroundColor on Tap
- Pass html.dropdownlistfor current value to Actionlink?
- Filter Field in List by boolean value in MVC
- Android How to change icon with button
- frame.origin Change error on View when Table Cell selected
- How to pass a specific model field to views' functions or methods?
- python django class based view and functional view
- django rest framework - adding to views.obtain_auth_token
- Is it possible to draw on an SFML window regardless of views?
- SQL Join Views - Duplicate Field
- Android change layout depending on if statement
- how to merge entity reference relationship field value
Related Questions in INVALIDATION
- Sprite Animation inside GridView fail to run
- Excel 2013 Invalidate Ribbon control not working
- Invalidate a region for smooth animation c#
- How to cache the image of the control?
- Android RatingBar painting itself wrong
- Android: View embedded in layout. onDraw() method triggered but the screen not update immediately
- Restarting a Youtube Player View (Invalidation does not work)
- How to abandon (invalidate without saving) a cache line on x86_64?
- BlackBerry invalidate speed problem
- How to invalidate() on return from a dialog?
- Invalidating image too fast
- JBoss TreeCache vs PojoCache when using invaludation rather than replication
- Invalidate is not redrawing the screen. Android
- How D2D implement scroll screen function?
- How to invalidate() a View from another thread?
Related Questions in PIANO
- How do I start a tone and let it run indefinitely till i stop it explicitly?
- Access UIButtons from the interface
- How to playback piano chords with an android?
- How to implement a MIDI keyboard into python
- FFT What are the other frequencies when a single piano note is played
- Draw piano keys in GTKsharp
- Arduino - Measuring the time interval between one button press and release - Add Velocity to MIDI Keyboard
- How to record Piano?
- Piano pitch detection
- How can I implement the piano key frequency function in C#?
- Set a sound frequency with Java code
- Play more sounds at the same time c#
- C++ Beep not working
- How to convert midi files to keypresses (in Python)?
- Beating and two-stage decay of the piano sound
Related Questions in ANDROID-RUNONUITHREAD
- Starting and stopping progressbar on UI thread from class
- Update GUI from Application Class
- How does call app works when the call app is removed from task list (aka Overview screen) in Android?
- setListAdapter not displaying
- how to re-start a thread?
- Is a Fragment on the UIThread?
- How to update the listview from another thread with kotlin
- Unable to update seekbar with Handler
- Thread doesn't execute a Dialog?
- ArrayAdapter notifyDataSetChanged not being executed on UI thread
- runOnUIThread throwing error and crashing app
- Activity not updating in tight loop
- nullPointerException on calling getActivity().runOnUiThread{new Runnable inside Fragment
- How to pass data that changes real-time from activity to fragment?
- Executing operations on UI thread after delay
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 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.