在面试时候经常被问到多线程的相关问题: 今天在测试的时候发现下面的代码会抛出异常: java.lang.IllegalThreadStateException public static void main(String[] args)throws Exception{ Test_Thread temp = new Test_Thread(); Test_Thread temp1 = new Test_Thread(); Thread t = new Thread(temp); Thread t
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Runtime.InteropServices; using System.Threading.Tasks; using System.Windows.Forms; namespace Demo { static class Program { /// <summary> /// 用于判
using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using System.Threading; namespace WindowsFormsApplication1 { static class Program { /// <summary> /// The main entry point for the application. /// </s
创建类Mutex.cs: using System; using System.Linq; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; namespace Demo { public class Mutex { [DllImport("coredll.dll", EntryPoint = "CreateMutex", SetLas
本来想着用handlerpostdelay就可以实现,没想到演示后关闭应用居然报错. 后来想到是没有了activity. ((Activity)context).isFinishing() 可以传入context,再强转成activity.判断此acitvity是否存在,之后就可有去放心的弹出了. 通过sharedpreference判断是否购买. public class MyDialog { static SharedPreferences myShare; public sta