对于win10系统窗口提示Officebackgroundtaskhandler.exe修复方法感兴趣的读者,本文将提供您所需要的所有信息,我们将详细讲解officebackgroundtaskhan
对于win10系统窗口提示Officebackgroundtaskhandler.exe修复方法感兴趣的读者,本文将提供您所需要的所有信息,我们将详细讲解officebackgroundtaskhandlerregistration,并且为您提供关于android – AsyncTask;调用方法onPreExecute()后调用doInbackground()、android – AsyncTask中onPreExecute和doInBackground之间的延迟很大、android – 停止AsyncTask doInBackground方法、android – 执行AsyncTask onCancelled()和AsyncTask.doInBackground()的时间的宝贵知识。
本文目录一览:- win10系统窗口提示Officebackgroundtaskhandler.exe修复方法(officebackgroundtaskhandlerregistration)
- android – AsyncTask;调用方法onPreExecute()后调用doInbackground()
- android – AsyncTask中onPreExecute和doInBackground之间的延迟很大
- android – 停止AsyncTask doInBackground方法
- android – 执行AsyncTask onCancelled()和AsyncTask.doInBackground()的时间
win10系统窗口提示Officebackgroundtaskhandler.exe修复方法(officebackgroundtaskhandlerregistration)
导读:(win10系统经常弹出一个神秘窗口提示Officebackgroundtaskhandler.exe的解决方法)相关电脑教程分享。
你的 Windows 10 电脑,是否也会时不时弹出或闪现一个神秘窗口呢?该窗口在弹出后就立即消失;并伴随着以下几种症状:可能是弹出后显示未响应;可能是让你的电脑每隔一小时就卡顿一小下;还可能是影响你的全屏游戏或应用,使你跳出至系统桌面。那么遇见这种问题我们该如何解决呢?下面小编就详细的为大家介绍win10系统经常弹出一个神秘窗口提示Officebackgroundtaskhandler.exe的解决方法。 具体解决方法如下:原因解析: 首先,使电脑产生问题的文件,叫做 “officebackgroundtaskhandler.exe” 。目前我们还不清楚它的具体作用,但它默认要每隔一小时就自动运行一次,十分烦人有木有?
我们要做的就是将它的运行账户改为系统账户,使其在后台默认操作,而不弹窗干扰我们的正常使用操作。 具体操作:1、鼠标右击“此电脑”,选择“管理”。
2、选择“系统工具” - “任务计划程序” - “任务计划程序库” - “Microsoft” - “Office”。
3、选中 “OfficeBackgroundTaskHandlerRegistration”。
4、右击 “OfficeBackgroundTaskHandlerRegistration” 选择属性。
5、点击“更改用户或组”。
6、输入 “SYstem”,点击确定。
7、再次点击“确定”,然后关闭“计算机管理”窗口。
以上就是win10系统经常弹出一个神秘窗口提示Officebackgroundtaskhandler.exe的解决方法了,成功将每小时的闪现弹窗,改为在后台默默运行,不再弹窗。我们再也不会被这个 Office 弹窗影响使用了 。该方法及不影响office的正常使用而且可以正常的使用电脑。
总结
以上是小编为你收集整理的win10系统窗口提示Officebackgroundtaskhandler.exe修复方法全部内容。
如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。
android – AsyncTask;调用方法onPreExecute()后调用doInbackground()
码
public void doMysqL() { Log.v("doMysqL","accessed"); new AsyncTask<Void,Void,String>() { @Override protected void onPreExecute() { super.onPreExecute(); Log.e("AsyncTask","onPreExecute"); } @Override protected String doInBackground(Void... params) { Log.v("AsyncTask","doInBackground"); String msg = ""; DefaultHttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://172.16.100.172:52273/MysqL"); ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new BasicNameValuePair("myday",Integer.toString(day_picker.getYear()) + addZero(day_picker.getMonth() + 1) + addZero(day_picker.getDayOfMonth()))); nameValuePairs.add(new BasicNameValuePair("mystar",changeStar(day_picker.getMonth() + 1,day_picker.getDayOfMonth()))); nameValuePairs.add(new BasicNameValuePair("mybt",changeBloodType(blood_picker.getValue()))); nameValuePairs.add(new BasicNameValuePair("mynum","" + myPhone.getText())); nameValuePairs.add(new BasicNameValuePair("yournum","" + partnerPhone.getText())); nameValuePairs.add(new BasicNameValuePair("myregID",regid)); try { Log.v("setEntity","before"); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); Log.v("setEntity","after"); } catch (UnsupportedEncodingException e1) { Log.v("UnsupportedEncodingException",""); e1.printstacktrace(); } //172.16.101.28 try { Log.v("post","before"); HttpResponse httpresponse = httpclient.execute(httppost); Log.v("post","after"); Log.v("HttpResponse ",httpresponse.getEntity().toString()); } catch (ClientProtocolException e) { Log.v("ClientProtocolException","ClientProtocolException"); e.printstacktrace(); } catch (IOException e) { Log.v("IOException","IOException"); e.printstacktrace(); } return msg; } @Override protected void onPostExecute(String msg) { Log.v("AsyncTask","onPostExecute"); } }.execute(null,null,null); }
我在代码“Log.v(”AsyncTask“,”doInBackground“)中有一个日志语句;
但它不会出现在记录器中的Log.v(“AsyncTask”,“doInBackground”);
解决方法
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
因为在较低版本的Android中,所有AsyncTasks都在单个后台线程中执行.所以新任务可能会等待,直到其他任务工作.
在Android的较低版本(实际上在HONEYCOMB之前),您无法在执行器上执行AsyncTask.
将您的代码更改为
public void executeAsyncTask() { AsyncTask<Void,String> task = new AsyncTask<Void,"onPreExecute"); } @Override protected String doInBackground(Void... params) { Log.v("AsyncTask","doInBackground"); String msg = null; // some calculation logic of msg variable return msg; } @Override protected void onPostExecute(String msg) { Log.v("AsyncTask","onPostExecute"); } }; if(Build.VERSION.SDK_INT >= 11/*HONEYCOMB*/) { task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } else { task.execute(); } }
android – AsyncTask中onPreExecute和doInBackground之间的延迟很大
new AsyncTask<Void,Void,Void>() { private ProgressDialog mProgressDialog; @Override protected void onPreExecute() { Log.i(TAG,"Pre execute: " + System.currentTimeMillis()); super.onPreExecute(); mProgressDialog = ProgressDialog.show(NewWeatherActivity.this,null,getResources().getString(R.string.weather_is_updating)); mProgressDialog.setCancelable(false); Log.i(TAG,"Pre executed: " + System.currentTimeMillis()); } @Override protected Void doInBackground(Void... voids) { Log.i(TAG,"Do in background: " + System.currentTimeMillis()); // Some actions Log.i(TAG,"Done in background: " + System.currentTimeMillis()); return null; } @Override protected void onPostExecute(Void aVoid) { Log.i(TAG,"Post execute: " + System.currentTimeMillis()); super.onPostExecute(aVoid); mProgressDialog.dismiss(); Log.i(TAG,"Post executed: " + System.currentTimeMillis()); } }.execute();
日志:
I/TVLauncher/NewWeatherActivity(21691): Pre execute: 1354798705667
I/TVLauncher/NewWeatherActivity(21691): Pre executed: 1354798705713
I/TVLauncher/NewWeatherActivity(21691): Do in background:
1354798724063 I/TVLauncher/NewWeatherActivity(21691): Done in
background: 1354798724083 I/TVLauncher/NewWeatherActivity(21691): Post
execute: 1354798724083 I/TVLauncher/NewWeatherActivity(21691): Post
executed: 1354798725046
因此,onPreExecute和doInBackground之间的延迟大约是19秒.为什么?
解决方法
AsyncTasks现在按顺序运行.这意味着新的异步任务在最后一个完成之前不会运行.而不是调用执行尝试调用
executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,“”);
这可能会将延迟降低到可忽略的水平.
android – 停止AsyncTask doInBackground方法
我在类中创建了一个AsyncTask,我从一个片段调用该任务.问题是我想在片段被销毁时停止doInBackground方法.为此,我在编写AsyncTask的类中创建了一个方法,并在该方法中对Asynctask对象使用了cancel(true).当我从片段onDestroy()调用此方法时,后台进程仍在运行. Plz告诉我停止asynctask的doInBackground的正确方法.
这是编写asynctask的类
public class CarDetail implements Parcelable{
private String carId;
private String carName;
private String imageUrl;
private String thumbUrl;
private String dailyPrice;
private String weeklyPrice;
private String weekendPrice;
private String deposit;
private String minimumAge;
private String color;
private String make;
private String location;
private String bodyType;
private String fuelType;
private String transmission;
private String carType;
private String model;
private String description;
private Bitmap image;
private Bitmap thumbImage;
private Carlistadapter caradapter;
private ImageLoadTask task = new ImageLoadTask();
public CarDetail() {
super();
// Todo Auto-generated constructor stub
}
public CarDetail(String carId, String carName, String imageUrl,
String thumbUrl, String dailyPrice, String weeklyPrice,
String weekendPrice, String deposit, String minimumAge,
String color, String make, String location, String bodyType,
String fuelType, String transmission, String carType, String model,
String description) {
super();
this.carId = carId;
this.carName = carName;
this.imageUrl = imageUrl;
this.thumbUrl = thumbUrl;
this.dailyPrice = dailyPrice;
this.weeklyPrice = weeklyPrice;
this.weekendPrice = weekendPrice;
this.deposit = deposit;
this.minimumAge = minimumAge;
this.color = color;
this.make = make;
this.location = location;
this.bodyType = bodyType;
this.fuelType = fuelType;
this.transmission = transmission;
this.carType = carType;
this.model = model;
this.description = description;
// TO BE LOADED LATER - OR CAN SET TO A DEFAULT IMAGE
this.image = null;
this.thumbImage = null;
}
public String getCarId() {
return carId;
}
public void setCarId(String carId) {
this.carId = carId;
}
public String getCarName() {
return carName;
}
public void setCarName(String carName) {
this.carName = carName;
}
public String getimageUrl() {
return imageUrl;
}
public void setimageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public String getThumbUrl() {
return thumbUrl;
}
public void setThumbUrl(String thumbUrl) {
this.thumbUrl = thumbUrl;
}
public String getDailyPrice() {
return dailyPrice;
}
public void setDailyPrice(String dailyPrice) {
this.dailyPrice = dailyPrice;
}
public String getWeeklyPrice() {
return weeklyPrice;
}
public void setWeeklyPrice(String weeklyPrice) {
this.weeklyPrice = weeklyPrice;
}
public String getWeekendPrice() {
return weekendPrice;
}
public void setWeekendPrice(String weekendPrice) {
this.weekendPrice = weekendPrice;
}
public String getDeposit() {
return deposit;
}
public void setDeposit(String deposit) {
this.deposit = deposit;
}
public String getMinimumAge() {
return minimumAge;
}
public void setMinimumAge(String minimumAge) {
this.minimumAge = minimumAge;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public String getMake() {
return make;
}
public void setMake(String make) {
this.make = make;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getBodyType() {
return bodyType;
}
public void setBodyType(String bodyType) {
this.bodyType = bodyType;
}
public String getFuelType() {
return fuelType;
}
public void setFuelType(String fuelType) {
this.fuelType = fuelType;
}
public String getTransmission() {
return transmission;
}
public void setTransmission(String transmission) {
this.transmission = transmission;
}
public String getCarType() {
return carType;
}
public void setCarType(String carType) {
this.carType = carType;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Bitmap getimage() {
return image;
}
public void setimage(Bitmap image) {
this.image = image;
}
public Bitmap getThumbImage() {
return thumbImage;
}
public void setThumbImage(Bitmap thumbImage) {
this.thumbImage = thumbImage;
}
public void loadImage(Carlistadapter caradapter) {
// HOLD A REFERENCE TO THE ADAPTER
this.caradapter = caradapter;
if (thumbUrl != null && !thumbUrl.equals("")) {
//new ImageLoadTask().execute(thumbUrl);
task.execute(thumbUrl);
}
}
// ASYNC TASK TO AVOID CHOKING UP UI THREAD
private class ImageLoadTask extends AsyncTask<String, String, Bitmap> {
@Override
protected void onPreExecute() {
Log.i("ImageLoadTask", "Loading image...");
}
// ParaM[0] IS IMG URL
protected Bitmap doInBackground(String... param) {
Log.i("ImageLoadTask", "Attempting to load image URL: " + param[0]);
try {
Bitmap b = JsonParser.downloadBitmap(param[0]);
return b;
} catch (Exception e) {
e.printstacktrace();
return null;
}
}
protected void onProgressUpdate(String... progress) {
// NO OP
}
protected void onPostExecute(Bitmap ret) {
if (ret != null) {
Log.i("ImageLoadTask", "Successfully loaded " + carName + " image");
image = ret;
if (caradapter != null) {
// WHEN IMAGE IS LOADED NOTIFY THE ADAPTER
caradapter.notifyDataSetChanged();
}
} else {
Log.e("ImageLoadTask", "Failed to load " + carName + " image");
}
}
}
/* everything below here is for implementing Parcelable */
// 99.9% of the time you can just ignore this
public int describeContents() {
return 0;
}
// write your object's data to the passed-in Parcel
public void writetoParcel(Parcel out, int flags) {
out.writeString(carId);
out.writeString(carName);
out.writeString(imageUrl);
out.writeString(thumbUrl);
out.writeString(dailyPrice);
out.writeString(weeklyPrice);
out.writeString(weekendPrice);
out.writeString(deposit);
out.writeString(minimumAge);
out.writeString(color);
out.writeString(make);
out.writeString(location);
out.writeString(bodyType);
out.writeString(fuelType);
out.writeString(transmission);
out.writeString(carType);
out.writeString(model);
out.writeString(description);
}
// this is used to regenerate your object. All Parcelables must have a CREATOR that implements these two methods
public static final Parcelable.Creator<CarDetail> CREATOR = new Parcelable.Creator<CarDetail>() {
public CarDetail createFromParcel(Parcel in) {
return new CarDetail(in);
}
public CarDetail[] newArray(int size) {
return new CarDetail[size];
}
};
// example constructor that takes a Parcel and gives you an object populated with it's values
private CarDetail(Parcel in) {
carId = in.readString();
carName = in.readString();
imageUrl = in.readString();
thumbUrl = in.readString();
dailyPrice = in.readString();
weeklyPrice = in.readString();
weekendPrice = in.readString();
deposit = in.readString();
minimumAge = in.readString();
color = in.readString();
make = in.readString();
location = in.readString();
bodyType = in.readString();
fuelType = in.readString();
transmission = in.readString();
carType = in.readString();
model = in.readString();
description = in.readString();
}
public void stopImageLoadTask(){
task.cancel(true);
Log.d("stop", "stop");
}
这是片段
public class ServiceCarListFragment extends Fragment {
private String url;
private ArrayList<CarDetail> carDetailList = new ArrayList<CarDetail>();
private Carlistadapter adapter;
private ListView mList ;
private ProgressDialog progressDialog;
OnCarListItemSelectedListener mCallback;
private boolean connectionStatus;
// Container Activity must implement this interface
public interface OnCarListItemSelectedListener {
public void onCarSelected(CarDetail car);
}
@Override
public void onAttach(Activity activity) {
// Todo Auto-generated method stub
super.onAttach(activity);
// This makes sure that the container activity has implemented
// the callback interface. If not, it throws an exception
try {
mCallback = (OnCarListItemSelectedListener) activity;
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString()
+ " must implement OnCarListItemSelectedListener");
}
}
@Override
public void onCreate(Bundle savedInstanceState) {
// Todo Auto-generated method stub
super.onCreate(savedInstanceState);
Log.d("Services", "On Create");
url = getActivity().getIntent().getStringExtra("url");
adapter = new Carlistadapter(getActivity() , carDetailList);
ConnectionHandler conn = new ConnectionHandler();
connectionStatus = conn.connectionStatus(getActivity());
if(connectionStatus){
new DownloadCarDetail().execute(url);
}
else{
DialogFragment newFragment = new DialogHandler(getActivity());
newFragment.show(getFragmentManager(), "internet");
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Todo Auto-generated method stub
Log.d("Services", "On CreateView");
View v = inflater.inflate(R.layout.fragment_service_car_list, container,false);
mList = (ListView)v.findViewById(R.id.list);
mList.setAdapter(adapter);
mList.setonItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View selectedView, int position,
long id) {
// Todo Auto-generated method stub
CarDetail car = (CarDetail)adapter.getItem(position);
mCallback.onCarSelected(car);
}
});
return v;
}
class DownloadCarDetail extends AsyncTask<String, String, ArrayList<CarDetail>>{
@Override
protected void onPreExecute() {
// Todo Auto-generated method stub
super.onPreExecute();
progressDialog = ProgressDialog.show(getActivity(), null, "Loading...",true);
}
@Override
protected ArrayList<CarDetail> doInBackground(String... params) {
// Todo Auto-generated method stub
ArrayList<CarDetail> carDetailList = JsonParser.parseJson(params[0]);
return carDetailList;
}
@Override
protected void onPostExecute(ArrayList<CarDetail> carDetailList) {
// Todo Auto-generated method stub
//adapter = new Carlistadapter(getActivity(),ServiceCarListFragment.this.carDetailList);
//mList.setAdapter(adapter);
progressDialog.dismiss();
ServiceCarListFragment.this.carDetailList.addAll(carDetailList);
adapter.notifyDataSetChanged();
for (CarDetail car : carDetailList) {
// START LOADING IMAGES FOR EACH CAR
car.loadImage(adapter);
}
carDetailList.clear();
Log.d("ewgf", String.valueOf(carDetailList.size()));
}
}
@Override
public void onDestroy() {
// Todo Auto-generated method stub
super.onDestroy();
new CarDetail().stopImageLoadTask();
}
}
解决方法:
public final boolean cancel(boolean mayInterruptIfRunning)
尝试取消执行此任务.如果任务已经完成,已经取消或由于某些其他原因无法取消,则此尝试将失败.如果成功,并且在调用cancel时此任务尚未启动,则此任务永远不会运行.如果任务已经启动,则mayInterruptIfRunning参数确定执行此任务的线程是否应该在尝试停止任务时被中断.
使用isCancelled()
public final boolean isCancelled()
如果此任务在正常完成之前被取消,则返回true.如果在任务上调用cancel(boolean),则应定期从doInBackground(Object [])检查此方法返回的值,以尽快结束任务.
Android – Cancel AsyncTask Forcefully
在上面的链接中检查接受的答案和commonsware的答案
android – 执行AsyncTask onCancelled()和AsyncTask.doInBackground()的时间
Calling this method will result in onCancelled(Object) being invoked on the UI thread after doInBackground(Object[]) returns. Calling this method guarantees that onPostExecute(Object) is never invoked
但是,查看我的logcat,我可以看到onCancelled()方法在doInBackground()方法返回之前执行.
07-10 12:38:57.000: VERBOSE/AsyncTask(7473): doInBackground entered 07-10 12:38:57.000: VERBOSE/AsyncTask(7473): AsyncTask attempting to take the lock 07-10 12:38:57.000: VERBOSE/AsyncTask(7473): AsyncTask got the lock 07-10 12:38:57.420: VERBOSE/AsyncTask(7473): Start Item[0].state = 0 07-10 12:38:57.933: VERBOSE/AsyncTask(7473): onProgressUpdate entered 07-10 12:38:57.940: VERBOSE/AsyncTask(7473): onProgressUpdate exited 07-10 12:38:58.320: VERBOSE/(7473): onCancelListener cancelling AsyncTask 07-10 12:38:58.400: VERBOSE/AsyncTask(7473): onCancelled entered 07-10 12:38:58.400: VERBOSE/AsyncTask(7473): onCancelled exited 07-10 12:38:58.560: VERBOSE/AsyncTask(7473): Started checking file URL 07-10 12:38:58.601: VERBOSE/FileHost(7473): checkFile entered 07-10 12:38:58.641: VERBOSE/FileHost(7473): checkFile checking URI 07-10 12:38:58.691: DEBUG/dalvikvm(7473): threadid=19 wakeup: interrupted 07-10 12:38:58.710: VERBOSE/AsyncTask(7473): AsyncTask released the lock 07-10 12:38:58.710: VERBOSE/AsyncTask(7473): doInBackground exited
使用调试器并在onCancelled()方法和doInBackground()方法结束时设置断点,我还可以看到在doInBackground()结束之前调用onCancelled().
有没有什么方法我在我的AsyncTask中错误编码了一些东西,以实现Android Reference和我的应用程序行为之间的行为差异?
编辑为gallal添加一些代码:
@gallal,Activity包含这段代码.
private class OnCancelListener implements AddUrlDialog.CancelListener { @Override public void cancel() { if (addUrlInProgress == true) { addUrlInProgress = false; Log.v(TAG,"onCancelListener cancelling AsyncTask"); addUrlControl.stopUpdates(true); AddUrlDialog.dismiss(); } } }
AsyncTask.cancel在addUrlControl.stopUpdates()方法中调用.
public void stopUpdates(boolean cleanupLists) { if (asyncTaskExited != true) { cancelRequest = true; addUrlAsyncTask.cancel(true); //TEST httpRequest.abort(); // Also sends an abort to the HTTP request } }
AsyncTask doInBackground方法看起来像这样.
@Override protected Void doInBackground(Void... v) { Log.v(TAG,"doInBackground entered"); netConn = addUrlControl.myApp.getNetConn(); client = netConn.getHttpClient(); try { doInBackgroundBody(); } catch (Throwable t) { Log.e(TAG,"doInBackgroundBody threw an exception: ",t); } finally { addUrlControl.myApp.releaseNetConn(); } Log.v(TAG,"doInBackground exited"); return null; }
解决方法
所以,如果你在onCancelled()中进行清理,你实际上会在AsyncTask运行的同时执行此操作,这会使你的应用程序崩溃!这让我们改变了设计……
希望能帮助到你!
今天关于win10系统窗口提示Officebackgroundtaskhandler.exe修复方法和officebackgroundtaskhandlerregistration的分享就到这里,希望大家有所收获,若想了解更多关于android – AsyncTask;调用方法onPreExecute()后调用doInbackground()、android – AsyncTask中onPreExecute和doInBackground之间的延迟很大、android – 停止AsyncTask doInBackground方法、android – 执行AsyncTask onCancelled()和AsyncTask.doInBackground()的时间等相关知识,可以在本站进行查询。
本文标签: