React native run code on main thread
Ideally you should do not it. But some Android APIs may need code to be run on main thread. e.g. MediaRouter In that you can use following way to run the code on main thread. Cheers and Peace out !!!
Ideally you should do not it. But some Android APIs may need code to be run on main thread. e.g. MediaRouter In that you can use following way to run the code on main thread. Cheers and Peace out !!!
We can achieve this by isAlive() and join() methods of Thread class. isAlive() is not great at doing this task. So, we will be using join() method. Threadd class — implements Runnable : class Threadd implements Runnable{Thread t;String name; Threadd(){name = “how”;t = new Thread(this,name);System.out.println(“This is thread”);t.start();} public void run() {for(int i=0;i<20;i++){System.out.println(“This is run method”);try{Thread.sleep(100);}catch(InterruptedException … Read more
Java does not support native code but there is HotSpot technology that converts few parts of java instructions (byte code) into executable code in real time by compiling it. HotSpot provides Just-in-Time (JIT) compiler for bytecode. JIT compiler compiles code as it is needed. HotSpot is the memory that is provided by JVM to run … Read more
Java is a OOP (object oriented language). Which means we see ‘who is effected’ instead of ‘what is happening’. Java was conceived by : James Gosling Patrick Naughton Chris Warth Ed Frank Mike Sheridan at Sunmicrosystems inc. in 1991. Took 18 Months for first version At the start java’s name was oak Renamed to java … Read more
Java have two types of data types. Primitive Data Types User Defined Data Types Java is statically typed and also a strongly typed language : because we have to declare the type of each variable and one variable cannot store value of other type of variable. But languages like PHP, Python are dynamically typed because … Read more
Lambda expressions are functions without classes. These can be passes like objects and executed on demand. For More Info : Go Here Backup of page : Go Here