Android 问题,求大神解决!

06-29 10:49:34.195 23540-23540/com.ziyeyanhuo.assetmanagement E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ziyeyanhuo.assetmanagement, PID: 23540
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ziyeyanhuo.assetmanagement/com.ziyeyanhuo.assetmanagement.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.widget.DrawerLayout.setDrawerListener(android.support.v4.widget.DrawerLayout$DrawerListener)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2466)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2528)
at android.app.ActivityThread.access$800(ActivityThread.java:169)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5552)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.widget.DrawerLayout.setDrawerListener(android.support.v4.widget.DrawerLayout$DrawerListener)' on a null object reference
at com.ziyeyanhuo.assetmanagement.MainActivity.onCreate(MainActivity.java:54)
at android.app.Activity.performCreate(Activity.java:5975)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1111)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2419)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2528) 
at android.app.ActivityThread.access$800(ActivityThread.java:169) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421) 
at android.os.Handler.dispatchMessage(Handler.java:111) 
at android.os.Looper.loop(Looper.java:194) 
at android.app.ActivityThread.main(ActivityThread.java:5552) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759) 

7个回答

空指针,可能是drawerlayout对象或者listener参数对象是空的。最好把报错的代码段贴出来

程序直接闪退,新人求帮助!

132323232323232323

空指针异常,看看drawerlayout活动里有没有错

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.widget.DrawerLayout.setDrawerListener(android.support.v4.widget.DrawerLayout$DrawerListener)' on a null object reference
好像有空指针,有东西为null了

图片说明
你应该把你的类贴出来,

空指针。drawerlayout对象没有实例化。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
android连接wcf问题求大神解决
public class HelloService implements ISoapServicernrn private static final String NameSpace = "http://tempuri.org/";rn private static final String URL = "http://192.168.1.86:80/AndroidService.svc";rn private static final String SOAP_ACTION = "http://tempuri.org/fnTest";rn private static final String MethodName = "fnTest"; rnprivate static HelloService HomeLinkManager;rnpublic static HelloService getInstance() rn if (HomeLinkManager == null) rn HomeLinkManager = new HelloService();rn rn return HomeLinkManager;rnrnrnpublic HelloService() rnrnrnrnpublic SoapObject LoadResult() rn SoapObject request = new SoapObject(NameSpace, MethodName); // example方法中有一个String的参数,这里将“android client”传递到example中 rn request.addProperty("inputCommand", "oh"); // 获得序列化的Envelope rn SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); rn envelope.dotNet = true; envelope.bodyOut = request; // Android传输对象 rn HttpTransportSE transport = new HttpTransportSE(URL); rn transport.debug = true; // 调用WebService rn try transport.call(SOAP_ACTION, envelope); rn rn catch (IOException e) // TODO Auto-generated catch block rn e.getMessage(); rn rn catch (XmlPullParserException e) // TODO Auto-generated catch block rn e.getMessage(); try rn if (envelope.getResponse() != null) rn envelope.bodyIn.toString(); rn catch (SoapFault e) // TODO Auto-generated catch block rn e.getMessage(); rn rnrnrn SoapObject result = (SoapObject) envelope.bodyIn;rn //System.out.println(result.toString());rn //SoapObject result =(SoapObject) envelope.getResponse();rn return result;rnrn网上复制过来的代码使用,但是执行到 transport.call(SOAP_ACTION, envelope); 就会报错,说http404,但是我明明在iis里面可以访问地址的啊!弄了2天都不知哪里有问题请问有大神回答吗
求大神解决下问题
我是使用form表单提交到后台,然后导出excel。现在的问题是多次点击下载导致内存溢出。因为没有返回值也不好添加遮罩层。感觉是因为tomcat的内存不足导致的。请问有什么解决方法么?
大神,求解决,Android studio 的问题
我之前用eclipse adt 做好的项目拿Android studio打开然后又用adt打开(未修改)报错,怎么办?
android 调用 c 的问题 求大神解决
![图片说明](https://img-ask.csdn.net/upload/201509/03/1441292610_11668.png)n为什么我在配置完环境 在Android Tools-->add native support之后没生成.so文件,之后再Android tools就没这个选项了,还有以下错误 求解决
android调用webservice如何解决参数问题求大神解决
package com.city.list.main;rnrnimport java.io.IOException;rnimport java.io.InputStream;rnimport java.io.OutputStream;rnimport java.net.HttpURLConnection;rnimport java.net.URL;rnimport java.util.ArrayList;rnrnpublic class HttpConnSoap rn public ArrayList GetWebServre(String methodName, ArrayList Parameters, ArrayList ParValues) rn ArrayList Values = new ArrayList(); rn rn //ServerUrl是指webservice的url rn //10.0.2.2是让android模拟器访问本地(PC)服务器,不能写成127.0.0.1 rn //11125是指端口号,即挂载到IIS上的时候开启的端口 rn //Service1.asmx是指提供服务的页面 rn String ServerUrl = "http://10.0.2.2:3187/Service1.asmx"; rn //String soapAction="http://tempuri.org/LongUserId1"; rn String soapAction = "http://tempuri.org/" + methodName; rn //String data = ""; rn String soap = "" rn + "" rn + ""; rn String tps, vps, ts; rn String mreakString = ""; rn rn mreakString = "<" + methodName + " xmlns=\"http://tempuri.org/\">"; rn for (int i = 0; i < Parameters.size(); i++) rn tps = Parameters.get(i).toString(); rn //设置该方法的参数为.net webService中的参数名称 rn vps = ParValues.get(i).toString(); rn ts = "<" + tps + ">" + vps + ""; rn mreakString = mreakString + ts; rn rn mreakString = mreakString + ""; rn /* rn +"" rn +"string11661" rn +"string111" rn + "" rn */ rn String soap2 = ""; rn String requestData = soap + mreakString + soap2; rn //System.out.println(requestData); rn rn try rn URL url = new URL(ServerUrl); rn HttpURLConnection con = (HttpURLConnection) url.openConnection(); rn byte[] bytes = requestData.getBytes("utf-8"); rn con.setDoInput(true); rn con.setDoOutput(true); rn con.setUseCaches(false); rn con.setConnectTimeout(6000);// 设置超时时间 rn con.setRequestMethod("POST"); rn con.setRequestProperty("Content-Type", "text/xml;charset=utf-8"); rn con.setRequestProperty("SOAPAction", soapAction); rn con.setRequestProperty("Content-Length", "" + bytes.length); rn OutputStream outStream = con.getOutputStream(); rn outStream.write(bytes); rn outStream.flush(); rn outStream.close(); rn InputStream inStream = con.getInputStream(); rn rn //data=parser(inStream); rn //System.out.print("11"); rn Values = inputStreamtovaluelist(inStream, methodName); rn //System.out.println(Values.size()); rn return Values; rn rn catch (Exception e) rn System.out.print("2221"); rn return null; rn rn rn rn public ArrayList inputStreamtovaluelist(InputStream in, String MonthsName) throws IOException rn StringBuffer out = new StringBuffer(); rn String s1 = ""; rn byte[] b = new byte[4096]; rn ArrayList Values = new ArrayList(); rn Values.clear(); rn rn for (int n; (n = in.read(b)) != -1;) rn s1 = new String(b, 0, n); rn out.append(s1); rn rn rn System.out.println(out); rn String[] s13 = s1.split("><"); rn String ifString = MonthsName + "Result"; rn String TS = ""; rn String vs = ""; rn rn Boolean getValueBoolean = false; rn for (int i = 0; i < s13.length; i++) rn TS = s13[i]; rn System.out.println(TS); rn int j, k, l; rn j = TS.indexOf(ifString); rn k = TS.lastIndexOf(ifString); rn rn if (j >= 0) rn System.out.println(j); rn if (getValueBoolean == false) rn getValueBoolean = true; rn else rn rn rn rn if ((j >= 0) && (k > j)) rn System.out.println("FFF" + TS.lastIndexOf("/" + ifString)); rn //System.out.println(TS); rn l = ifString.length() + 1; rn vs = TS.substring(j + l, k - 2); rn //System.out.println("fff"+vs); rn Values.add(vs); rn System.out.println("退出" + vs); rn getValueBoolean = false; rn return Values; rn rn rn rn if (TS.lastIndexOf("/" + ifString) >= 0) rn getValueBoolean = false; rn return Values; rn rn if ((getValueBoolean) && (TS.lastIndexOf("/" + ifString) < 0) && (j < 0)) rn k = TS.length(); rn //System.out.println(TS); rn vs = TS.substring(7, k - 8); rn //System.out.println("f"+vs); rn Values.add(vs); rn rn rn rn rn return Values; rn rnrnrnrn /**rn * 获取所有货物的详细信息rn * rn * @returnrn */rn //如何解决webservice 中方法 带参数 在这如何进行赋值与传递 希望大神帮忙解决rn public List> getInfo(String title) //需要解决的地方 rn List> list = new ArrayList>();rn arrayList.clear();rn brrayList.clear();rn crrayList.clear();rn crrayList.add("Title");rn crrayList.add(title);rn crrayList = Soap.GetWebServre("selectInfo", arrayList, brrayList);rn for (int j = 0; j < crrayList.size(); j += 3) rn HashMap hashMap = new HashMap();rn hashMap.put("Title", crrayList.get(j));rn hashMap.put("Image", crrayList.get(j + 1));rn hashMap.put("Info",crrayList.get(j + 2));rn list.add(hashMap);rn rn return list;rn rnrnrnrn
求大神解决流媒体问题
就是提示流媒体资源服务器已关闭 要如何解决 有能解决的大神加我QQ 66685553rn给你个大红包
SQL问题,求大神解决~!!
SELECT Q.NAME DEVICE_NAME,T.NAME T_NAME,B.AVE,B.SD,SUM(CASE WHEN D.OUT_OF_CONTROL=1 THEN 1 ELSE 0 END)OUT_OF_CONTROL_TIME, COUNT(D.ID)TEST_TIME,D.TEST_ID,B.Batch_No,rn POWER(AVG(CASE WHEN D.ISCALPOINT=0 THEN POWER(D.TEST_VAL-[color=#FF0000]SSS[/color],2)ELSE NULL END),0.5),rn AVG(CASE WHEN D.ISCALPOINT=0 THEN D.TEST_VAL WHEN D.ISCALPOINT IS NULL THEN D.TEST_VAL ELSE NULL END)[color=#FF0000]SSS[/color]rn FROM QC_QCTEST_DATA D,QC_TEST T,QC_DEVICE Q,QC_QCTEST_BATCH B rn WHERE D.DEV_ID=1715rn AND TO_CHAR(D.TEST_DATE_TIME,'yyyy-MM')='2013-05'rn AND B.TYPE=2rn AND D.BATCH_ID=B.IDrn AND D.DEV_ID=Q.IDrn AND D.TEST_ID=T.ID rn GROUP BY D.TEST_ID,Q.NAME,T.NAME,B.AVE,B.SD,B.TYPE,B.Batch_Nornrnrnrn怎么写可以将下面红色SSS内容加到上面红色的位置进行计算???现在sql语句是错的
求大神解决一个问题
A:我用centos7下装docker 跑centos7的镜像 执行/bin/bash 出现permission denied2014/09/03 10:01:43 Error response from daemon: Cannot start container b6569c02695327b898f8545e97c23d94e5157c9265c945363253e6242fbfeb5d: permission deniedrnrn这个错误 谁知道什么问题吗rnrnrnrnrn[color=#FF0000]该问题来自CSDN Docker技术交流群(303806405),由版主xinshubiao整理。[/color]
求大神解决我的问题
[code=java] rn int a = 10;rn a =a++;rn System.out.println(a);rn int b = (--a)+(a--)+(a*10);rn b = b--;rn System.out.println(a); rn System.out.println(b); [/code]rn为什么输出的是8 和 98?? rn实在是想不通了 来个大神啊
tomcat问题求大神解决
八月 01, 2018 3:02:19 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: Loaded APR based Apache Tomcat Native library 1.1.32 using APR version 1.5.1. 八月 01, 2018 3:02:19 下午 org.apache....
求大神解决循环问题
用π/4≈1-1/3+1/5-1/7+……公式求π的近似值,直到发现某一项的绝对值小于10的负六次方为止,题目是这样的,请大神帮我看看我的程序为什么得到的结果是0.0000000000?rn程序如下:rn#include rn#include rnint main()rnrnint i,j;rndouble sum,sum1,sum2;rn for(i=1;;i=i+4)rn sum1=sum1+1/i;rn if(fabs(1/i)<=1e-6)break;rn rn for(j=3;;j=j+4)rn rn sum2=sum2+1/j;rn if(fabs(1/j<=1e-6))break; rn rn sum=4*(sum1-sum2);rn printf("%10.5lf",sum);rnreturn 0;rn
oracl问题,大神求解决!
现在我有一个定时存储过程 http://bbs.csdn.net/topics/new是每天晚上凌晨1点运行的,现在我需要每天白天去修改这个比例值,我想把很多天的比例值放在一张表中!让这个定时存储过程每天1点自动去找那张表中对应的比例值。这个应该怎么去做?rnrnrn附图:[img=https://img-bbs.csdn.net/upload/201501/19/1421653736_125601.jpg][/img]
一个问题,求大神解决
[code=c]// Enter.cpp : implementation filern//rnrn#include "stdafx.h"rn#include "fzq.h"rn#include "Enter.h"rnrnrn#ifdef _DEBUGrn#define new DEBUG_NEWrn#undef THIS_FILErnstatic char THIS_FILE[] = __FILE__;rn#endifrnrn/////////////////////////////////////////////////////////////////////////////rn// CEnter dialogrnrnrnCEnter::CEnter(CWnd* pParent /*=NULL*/)rn : CDialog(CEnter::IDD, pParent)rnrn //AFX_DATA_INIT(CEnter)rn // NOTE: the ClassWizard will add member initialization herern //AFX_DATA_INITrnrnrnrnvoid CEnter::DoDataExchange(CDataExchange* pDX)rnrn CDialog::DoDataExchange(pDX);rn //AFX_DATA_MAP(CEnter)rn // NOTE: the ClassWizard will add DDX and DDV calls herern //AFX_DATA_MAPrn DDX_Text( pDX,IDC_EDIT1,editor1);rn DDX_Text( pDX,IDC_EDIT2,editor2);rnrnrnextern player gameplayer[100];rnrnvoid CEnter::OnOK()rn rn char ch1[20];rn char ch2[20];rn GetDlgItem(IDC_EDIT1)->GetWindowText(ch1,20);rn GetDlgItem(IDC_EDIT2)->GetWindowText(ch2,20);rn gameplayer[0].name.Format("%s",ch1);rn gameplayer[1].name.Format("%s",ch2);rn CDialog::OnOK();rnrnrnrnrnBEGIN_MESSAGE_MAP(CEnter, CDialog)rn //AFX_MSG_MAP(CEnter)rn // NOTE: the ClassWizard will add message map macros herern //AFX_MSG_MAPrnEND_MESSAGE_MAP()rnrn/////////////////////////////////////////////////////////////////////////////rn// CEnter message handlersrn[/code]rn这是MFC中的一个文件,其中用到了全局对象playerrn定义如下rnclass playerrnrnpublic:rn player();rn virtual ~player();rn CString name; //存储姓名rn int num; //存储净胜场rn;rnrnrnplayer gameplayer[100];//定义为全局对象rn总是出现如下两个错误rnE:\vc6_setup\MSDev98\MyProjects\fzq\fzqView.cpp(35) : error C2146: syntax error : missing ';' before identifier 'gameplayer'rnE:\vc6_setup\MSDev98\MyProjects\fzq\fzqView.cpp(35) : fatal error C1004: unexpected end of file foundrn我上网查了很多解决方法都用不了rn真心求教
ztree问题求大神解决
点击服务器列表后显示的是这样的页面[img=https://img-bbs.csdn.net/upload/201702/17/1487301123_86960.png][/img]rn然后在该页面通过ip查询后,页面变成这样了[img=https://img-bbs.csdn.net/upload/201702/17/1487301162_275064.jpg][/img]rn有什么办法可以通过ip查询后只更新树,不重新生成一个新的树rn下面是我的代码,求各位帮我看看rnrn rn rn rn rn 服务器列表rn rn rn rn rn rn rn rn rn
求大神解决SOCKET的问题
这里有一段接口业务的问题rnrn接口传输方式:socketrn协议:tcp/iprnrn接口需求是这样说的:rn对报文接口,采用3des算法,数据发送方需先对报文头中账号和密码域使用数据密钥进行加密,再使用MAC密钥对报文头和报文体进行加押,密押经BCD扩展以后以16个字节方式传送。rnrn请大家帮我分析一下这个需求到底是要怎么计算的 ,还有 以16个字节方式传送是什么意思?rnrn万分感谢!
UITextView问题,求大神解决。
我想让屏幕变暗,在上面加了一层蒙版,然后在textview上输入周围会有白边
菜鸟问题,求大神解决~~~~~~
编了一个创建窗口的程序,编译能通过,但是在运行时窗口一闪而过!!!自己想了一个很笨得方法,用sleep函数,能延迟一会,但是还是达不到自己想要的效果!rn代码是:#includernrn#includernrn#includernrn#includernrn#define PI 3.1415926535898rnrnLRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;rnrnPOINT pt[5][3];rnrnint WINAPI WinMain(HINSTANCE hInstance,rn HINSTANCE hPrevInstance,rn LPSTR lpCmdLine,rn int nCmdShow)rnrn MSG Message;rnrn HWND hWnd;rnrn WNDCLASS WndClass;rnrn WndClass.cbClsExtra = 0;rnrn WndClass.cbWndExtra = 0;rn rn WndClass.hIcon = LoadIcon(NULL,IDI_APPLICATION);rnrn WndClass.hCursor = LoadCursor(NULL,IDC_ARROW);rnrn WndClass.hbrBackground = (HBRUSH)(GetStockObject(WHITE_BRUSH));rnrn WndClass.hInstance = hInstance;rn rn WndClass.lpfnWndProc = WndProc;rnrn WndClass.lpszClassName = "Pentagon";rnrn WndClass.lpszMenuName = NULL;rnrn WndClass.style = 0;rnrn if(!RegisterClass(&WndClass))rn rn MessageBeep(0);rnrn return FALSE;rn rnrn hWnd = CreateWindow("Pentagon",rn "五边形",rn WS_OVERLAPPEDWINDOW,rn CW_USEDEFAULT,rn 0,rn CW_USEDEFAULT,rn 0,rn NULL,rn NULL,rn hInstance,rn NULL);rnrn pt[0][0].x = 400; //第一块区域相关的坐标rn pt[0][0].y = 200 - (long)50 / (cos(PI / 5));rn pt[0][1].x = 400 - (long)((50 / cos(PI / 5)) * cos(PI / 10));rn pt[0][1].y = 200 - (long)(50 / cos(PI / 5) * sin(PI / 10));rn pt[0][2].x = 400;rn pt[0][2].y = 200;rnrn pt[1][0].x = 400 - (long)((50 / cos(PI / 5)) * cos(PI / 10)); //第二块区域相关的坐标rn pt[1][0].y = 200 - (long)(50 / cos(PI / 5) * sin(PI / 10));rn pt[1][1].x = 400 - (long)(50 * tan(PI / 5));rn pt[1][1].y = 250;rn pt[1][2].x = 400;rn pt[1][2].y = 200;rnrn pt[2][0].x = 400 - (long)(50 * tan(PI / 5)); //第三块区域相关的坐标rn pt[2][0].y = 250;rn pt[2][1].x = 400 + (long)(50 * tan(PI / 5));rn pt[2][1].y = 250;rn pt[2][2].x = 400;rn pt[2][2].y = 200;rnrn pt[3][0].x = 400 + (long)(50 * tan(PI / 5)); //第四块区域相关的坐标rn pt[3][0].y = 250;rn pt[3][1].x = 400 + (long)((50 / cos(PI / 5)) * cos(PI / 10));rn pt[3][1].y = 200 - (long)(50 / cos(PI / 5) * sin(PI / 10));rn pt[3][2].x = 400;rn pt[3][2].y = 200;rnrn pt[4][0].x = 400 + (long)((50 / cos(PI / 5)) * cos(PI / 10)); //第五块区域相关的坐标rn pt[4][0].y = 200 - (long)(50 / cos(PI / 5) * sin(PI / 10));rn pt[4][1].x = 400;rn pt[4][1].y = 200 - (long)50 / (cos(PI / 5));rn pt[4][2].x = 400;rn pt[4][2].y = 200;rnrnrn ShowWindow(hWnd,nCmdShow);rnrn UpdateWindow(hWnd);rnrn while(GetMessage(&Message, 0, 0, 0))rn rn TranslateMessage(&Message);rnrn DispatchMessage(&Message);rn rn return Message.wParam;rnrnrnlong WINAPI WndProc(HWND hWnd,rn UINT iMessage,rn UINT wParam,rn LONG lParam)rnrn HDC hDC;rnrn HBRUSH hBrush;rnrn HPEN hPen;rnrn PAINTSTRUCT PtStr;rnrn switch(iMessage)rn rn case WM_PAINT:rnrn hDC = BeginPaint(hWnd, &PtStr);rnrn hPen = CreatePen(PS_SOLID, 1, RGB(255, 0, 0)); //绘制红色的边rnrn hBrush = CreateSolidBrush(RGB(0, 255, 0)); //使用绿色画刷填充rnrn SelectObject(hDC, hPen);rnrn SelectObject(hDC, hBrush);rnrn Polyline(hDC, pt[0], 3);rnrn Polygon(hDC, pt[0], 3);rnrn DeleteObject(hPen); //绘制红色的边结束,释放画笔rnrn hPen = CreatePen(PS_SOLID, 1, RGB(0, 255, 0)); //绘制绿色的边rnrn hBrush = CreateSolidBrush(RGB(255, 255, 0)); //使用黄色画刷填充rnrn SelectObject(hDC, hPen);rnrn SelectObject(hDC, hBrush);rnrn Polyline(hDC, pt[1], 3);rnrn Polygon(hDC, pt[1], 3);rnrn DeleteObject(hPen); //绘制绿色的边结束,释放画笔rnrn hPen = CreatePen(PS_SOLID, 1, RGB(0, 0, 255)); //绘制蓝色的边rnrn hBrush = CreateSolidBrush(RGB(255, 0, 0)); //使用红色画刷填充rnrn SelectObject(hDC, hPen);rnrn SelectObject(hDC, hBrush);rnrn Polyline(hDC, pt[2], 3);rnrn Polygon(hDC, pt[2], 3);rnrn DeleteObject(hPen); //绘制蓝色的边结束,释放画笔rnrn hPen = CreatePen(PS_SOLID, 1, RGB(255, 0, 255)); //绘制紫色的边rnrn hBrush = CreateSolidBrush(RGB(0, 0, 255)); //使用蓝色画刷填充rnrn SelectObject(hDC, hPen);rnrn SelectObject(hDC, hBrush);rnrn Polyline(hDC, pt[3], 3);rnrn Polygon(hDC, pt[3], 3);rnrn DeleteObject(hPen); //绘制紫色的边结束,释放画笔rnrn hPen = CreatePen(PS_SOLID, 1, RGB(0, 255, 255)); //绘制青色的边rnrn hBrush = CreateSolidBrush(RGB(255, 0, 255)); //使用紫色画刷填充rnrn SelectObject(hDC, hPen);rnrn SelectObject(hDC, hBrush);rnrn Polyline(hDC, pt[4], 3);rnrn Polygon(hDC, pt[4], 3);rnrn DeleteObject(hPen); //绘制青色的边结束,释放画笔rnrn EndPaint(hWnd, &PtStr);rnrn Sleep(10000);rnrn case WM_DESTROY:rnrn PostQuitMessage(0);rnrn return 0;rnrn default:rnrn return(DefWindowProc(hWnd, iMessage, wParam, lParam));rn rnrnrnrn期待大神们给力的解答~~~
javabean的问题求大神解决
![图片说明](https://img-ask.csdn.net/upload/201611/13/1479043485_516703.png)
求大神帮我解决下问题
[code=c] unsigned char c_Wifi=0x11, 0x22, 0x33, 0x44, 0x55, 0x66;rnrnCString str = _T("BC:0F:2B:14:49:D9"); rn TCHAR seps = _T(":"); rn TCHAR* BT_token = _tcstok( (LPTSTR)(LPCTSTR)str, seps ); rn i=0;rn while( BT_token != NULL ) rn rn CString BT_S;rn BT_S.Format(_T("0x%s"),BT_token);rn rn AfxMessageBox(BT_S);rnrn BT_token = _tcstok( NULL, seps ); rn i++;rnrn [/code]rn主要问题 将CString 值存入 unsigned char 数组中rn
求大神解决下代码问题
Microsoft.Office.Interop.Excel.Application excel1 = new Microsoft.Office.Interop.Excel.Application();rn Excel.Workbook workbook1 = excel1.Workbooks._Open(@"D:\灾评\单产.xls", Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Valuern , Missing.Value, Missing.Value, Missing.Value, Missing.Value);rn Worksheet worksheet1 = (Worksheet)workbook1.Worksheets["Sheet1"];rn // string sss = Convert.ToString(worksheet1.Cells[1, 1]);rn Worksheet worksheet2 = (Worksheet)workbook1.Worksheets["Sheet2"];rn Worksheet worksheet3= (Worksheet)workbook1.Worksheets["Sheet3"];rn excel1.Visible = true;rn int matrixHeight = 300;rn int matrixWidth = 300;rn string[,] martix = new string[matrixHeight, matrixWidth];rn for (int i1 = 0; i1 < matrixHeight; i1++)rn for (int j1 = 0; j1 < matrixWidth; j1++)rn rn // martix[i, j] = String.Format("0_1", i + 1, j + 1);rn martix[i1, j1]=((Range)worksheet1.Cells[i1, j1]).Text.ToString();//此行出现问题(此行是将excel读入数组中)rn MessageBox.Show(martix[5, 5]);rn rnrnrnrnrn string temp1 = ((Range)worksheet1.Cells[5, 5]).Text.ToString();//此行无问题rn //string temp2 = ((Range)worksheet2.Cells[1, 2]).Text.ToString();rn MessageBox.Show(temp1);rn excel1.Quit();
AJAX问题。求大神解决!
[img=https://img-bbs.csdn.net/upload/201608/12/1470985160_350918.png][/img]rnrn跳转页面后。地址栏有参数。怎么才能使地址栏没有参数呢?求大牛解答
QProcess问题,求大神解决!!!
我想点击一个按钮然后调用外部程序rnQObject::connect(btn_helloui, SIGNAL(clicked()), helloui, SLOT(hello()));rnvoid helloui::hello()rnrn QProcess *process = new QProcess;rn if (process)rn process->start("./hello/hello");rnrn问题是在主程序退出时,启动的外部程序是不会随着主程序的退出而退出的。rn我查了查资料,说是用close()这个函数,但是我还是用不来。。我是小白……rn哪位大神可以帮我把hello()这个函数补充完整……
求大神解决小小问题
string a=20120802.000 , b=20120802.024;rnrn StreamReader myReader1 = new StreamReader(@"H:\high\temper\850\" + a, Encoding.GetEncoding("GB2312"));rn如果找不到该文件,我就换成rnrnrnStreamReader myReader1 = new StreamReader(@"H:\high\temper\850\" + b, Encoding.GetEncoding("GB2312"));rn这段代码咋实现,最好用IF来实现
mvc+EF+EASYUI问题,求大神解决
[img=https://img-bbs.csdn.net/upload/201404/27/1398580368_356955.png][/img]rnrn[img=https://img-bbs.csdn.net/upload/201404/27/1398580378_518365.png][/img]rnrnrn上面两张图,我想实现在发放记录里,根据当前用户的职位名称,获取薪资标准的基本工资。rnrnrn比如:高莉 是 经理,薪资标准里,经理的基本工资是5000,我想在发放记录里多一个列获取经理的基本工资,然后把当前的金额进行一个结算,显示在总金额列里,大神帮忙,小弟十分感谢!
求大神解决下这个问题
[img=https://img-bbs.csdn.net/upload/201804/12/1523547660_532045.png][/img][img=https://img-bbs.csdn.net/upload/201804/12/1523547666_627945.png][/img]这个要怎么改啊,学的很基础的东西。。
java问题,求大神解决
1、怎么调用父类被重写的方法?创建了子类对象,用super.方法名的方式为什么会编译错误?rnclass Z rn static void f() rn System.out.println("Hello!"); rn rnrnrnclass B extends Z rn static void f() rn System.out.println("Goodbye!"); rn rn rn public static void main(String[] args) rn B bb = new B();rn super.f();rn rnrnrn错误:rn-------------------------------------------------------------------------------rnZ.java:14: 错误: 无法从静态上下文中引用非静态 变量 superrn super.f();rn ^rn1 个错误rn-------------------------------------------------------------------------------rnrn2、为什么没有结果输出?rn代码:rnclass Computer rn public void turnOn(Computer computer) rn rn rn rn public static void main(String[] args) rn Computer computer = new Computer();rn computer.turnOn(new PC());rn computer.turnOn(new NBC());rn rnrnrnclass PC extends Computer rn public void turnOn() rn System.out.println("PC has turn on"); rn rnrnrnclass NBC extends Computer rn public void turnOn() rn System.out.println("NBC has turn on"); rn rn
hibernate 问题 求大神解决。
手动为数据库Menus表增加一列后 用Hql:select o from Menus 语句去查 其他的列的数据能得到 而我新增加那一列的数据取不到。
android控件不展示,求大神解决
小弟刚刚学习android,新手一枚,这两天再搞android通过webservice取的数据展示到listview上rn我经过调试,确定数据已经取到,sql也非常简单,select * from table,但是list控件并没有展示到模拟器上,搞了很久也没找到问题的根本,希望有大神能够帮助指点一下,感激不尽rnrn以下是我的android代码:rnrnrnpackage com.dcdz.carmensys;rnrnimport java.sql.PreparedStatement;rnimport java.sql.ResultSet;rnimport java.util.ArrayList;rnimport java.util.Collection;rnimport java.util.HashMap;rnimport java.util.Iterator;rnimport java.util.List;rnimport org.apache.http.HttpResponse;rnimport org.apache.http.HttpStatus;rnimport org.apache.http.NameValuePair;rnimport org.apache.http.client.HttpClient;rnimport org.apache.http.client.entity.UrlEncodedFormEntity;rnimport org.apache.http.client.methods.HttpGet;rnimport org.apache.http.client.methods.HttpPost;rnimport org.apache.http.impl.client.DefaultHttpClient;rnimport org.apache.http.message.BasicNameValuePair;rnimport org.apache.http.protocol.HTTP;rnimport org.apache.http.util.EntityUtils;rnimport org.json.JSONArray;rnimport org.json.JSONException;rnimport org.json.JSONObject;rnrnimport com.dcdz.db.DbHelper;rnimport com.example.carmensys.R;rnrnimport android.os.Bundle;rnimport android.os.Handler;rnimport android.os.Message;rnimport android.os.StrictMode;rnimport android.annotation.SuppressLint;rnimport android.app.Activity;rnimport android.app.ListActivity;rnimport android.view.Menu;rnimport android.view.View;rnimport android.widget.ListView;rnimport android.widget.SimpleAdapter;rnrnrnpublic class MainActivity extends ListActivity rn DbHelper db=new DbHelper();rn private PreparedStatement pstmt;rn private ResultSet resultSet;rn ArrayList> list=new ArrayList>();rn SimpleAdapter sp=null;rn rn @SuppressLint("NewApi")rn @Overridern protected void onCreate(Bundle savedInstanceState) rn super.onCreate(savedInstanceState);rn setContentView(R.layout.activity_main);rn Thread th=new Thread(ran);rn th.start();rn rn rn rn Handler handler=new Handler()rn @Override rn public void handleMessage(Message msg) rn super.handleMessage(msg); rn rn showList();rn rn rn ;rn rn public void showList()rn SimpleAdapter sp=new SimpleAdapter(this, list, R.layout.listitemone, new String[]"userid","username","usertime", new int[]R.id.userid,R.id.username,R.id.usertime);rn setListAdapter(sp);rn rn rn Runnable ran=new Runnable()rn rn @Overridern public void run()rn rn getlist();rn rn ;rn rn public void getlist()rn HashMap map =new HashMap();rn String requestUrl="http://192.168.1.104:8080/SysCarMen/servlet/getListServlet";rn HttpClient client = new DefaultHttpClient(); rn // 根据URL创建HttpPost实例 mmrn HttpPost post = new HttpPost(requestUrl); rn HttpGet getx=new HttpGet(requestUrl);rn List params = new ArrayList(); rn params.add(new BasicNameValuePair("", "")); rn try rn // 设置URL编码 rn post.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8)); rn // 发送请求并获取反馈 rn HttpResponse response = client.execute(post); rn rn rn // 判断请求是否成功处理 rn if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) rn // 解析返回的内容 rn String result = EntityUtils.toString(response.getEntity()); rn JSONArray jsonArray = new JSONArray(result);rn JSONObject jsonObject; rn for (int i = 0; i < jsonArray.length(); i++) rn jsonObject = jsonArray.getJSONObject(i);rn list.add(getMap(jsonObject.toString())); rn rn System.out.println(list.toArray());rn rn rn catch (Exception e) rn e.printStackTrace(); rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn public static HashMap getMap(String jsonString)rn rn JSONObject jsonObject;rn tryrn rn jsonObject = new JSONObject(jsonString); @SuppressWarnings("unchecked")rn Iterator keyIter = jsonObject.keys();rn String key;rn String value;rn HashMap valueMap = new HashMap();rn while (keyIter.hasNext())rn rn key = (String) keyIter.next();rn value = jsonObject.get(key).toString();rn valueMap.put(key, value);rn rn return valueMap;rn rn catch (JSONException e)rn rn e.printStackTrace();rn rn return null;rn rn rn @Overridern public boolean onCreateOptionsMenu(Menu menu) rn // Inflate the menu; this adds items to the action bar if it is present.rn getMenuInflater().inflate(R.menu.main, menu);rn return true;rn rnrnrnrnrn```rn rn```rnrn
android运行出问题怎么办?求大神解决
com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Multi dex requires Build Tools 21.0.0 / Current: 19.1
android 源码下载 问题,求大神
rn源码下载现在愁死我啦,大神们求指教,在线等rnrn整了好几天啦 现在遇到这几个问题rnrn[b]1. 重启虚拟机后 就找不到 repo命令[/b]rn未找到 'repo' 命令,您要输入的是否是:rn命令 'rep' 来自于包 'rep' (universe)rn命令 'repl' 来自于包 'nmh' (universe)rn命令 'repl' 来自于包 'mailutils-mh' (universe)rnrepo:找不到命令rnrn需要重新配置一遍才能找到rnrn[b]2. 那个 ubuntu 文件夹已经15G啦 我都不知道我源码下载那里去啦[/b]rnrn新建的目录我看了一下就40 几kb ,我都找不到那个10多G的东西去那里rnrn注: 我是直接用的root用户下载的,因为这个有问题吗? 跟普通用户有区别吗
求大神帮忙解决android中的编程问题
package mobile.android.first;rnimport java.util.Random;rnimport android.graphics.Color;rnimport android.app.Activity;rnimport android.os.Bundle;rnimport mobile.android.first.CircleCanvas.CircleInfo;rnimport android.view.View;rnimport android.view.ViewGroup;rnimport android.view.ViewGroup.LayoutParams;rnpublic class main extends Activity rn rn private CircleCanvas mCircleCanvas;rn @Overridern public void onCreate(Bundle savedInstanceState)rn super.onCreate(savedInstanceState);rn ViewGroup.viewGroup=(ViewGroup)getLayoutInflater().inflate(R.layout.main,null);rn mCircleCanvas=new CircleCanvas(this);rn viewGroup.addView(mCircleCanvas,new LayoutParams(LayoutParams.FILL_PARENT,350));rn setContentView(viewGroup);rn rn public void onClick_DrawRandomCircle(View view)rn Random random=new Random();rn float randomX=(float)(100+random.nextInt(100));rn float randomY=(float)(100+random.nextInt(100));rn float randomRadius=(float)(20+random.nextInt(40));rn int randomColor=0;rn if(random.nextInt(100)>50)rn randomColor=Color.BLUE;rn elsern if(random.nextInt(100)<50)rn randomColor=Color.RED;rn elsern randomColor=Color.GREEN;rn rn CircleInfo circleInfo=new CircleInfo();rn circleInfo.setX(randomX);rn circleInfo.setY(randomY);rn circleInfo.setRadius(randomRadius);rn circleInfo.setColor(randomColor);rn mCircleCanvas.mCircleInfos.add(circleInfo);rn mCircleCanvas.invalidate();rn rn rn public void onClick_Clear(View view)rn mCircleCanvas.mCircleInfos.clear();rn mCircleCanvas.invalidate();rn rn rn rn报错内容:rn此行的多个标记rn - viewGroup cannot be resolved or is not rn a fieldrn - 行断点:main [行: 16] - rn onCreate(Bundle)rn - 无法解析 viewGroup,或者它不是字段rn如何解决好啊???rn
android问题,求大神解答
为什么会这样![图片](https://img-ask.csdn.net/upload/201611/13/1479048427_425951.jpg)
android viewpager问题 求大神
今天开发的时候,在fragment里面用到了viewpager. rnviewpager里面又有两个fragment,rn我们actionbar的title用的是当前fragment的名称,rn这个时候我就懵了,title显示的是viewpager里面一个fragment的名称rn求大神~问一下这三个fragment什么关系
求大神解决
使用application.exit();为什么不能退出程序并且结束后面代码的执行??rn
求大神解决javascript
下面的是我在网站找的一个随机排序的东西,但是他的排序是这样的:rn第一场:01rn第二场:02rn第三场:03rn第四场:04rn第五场:05rn第六场:06rn代码会自动生成(这个id就是场次,同时input内容对应的就是后面的01/02/03以此类推)在 rn rn rn rn rn rn rnrn[code=javascript] [/code]
求大神帮忙解决
import java.io.*;rnpublic class Calculator rn // 定义相关变量rn private String sum = null;rn private String qbrc = null;rn private double qbr1 = 1;rn private double qbr2 = 1;rn String abr1;rn String abr2;rn public Calculator()rn rn rn public void sumT()rn /*rn * 接口功能:进行相关的输入和类型转换 rn * 接口输入:空 rn * 接口输出:空 rn */rn tryrn System.out.println("欢迎使用!!!/n此计算器除可以进行数字各种相关运算还可以进行字符串的相加");rn System.out.print("请您输入您的第一次输入:");rn BufferedReader br1 = new BufferedReader(new InputStreamReader(System.in));rn System.out.print("请输入您的第二次输入:");rn BufferedReader br2 = new BufferedReader(new InputStreamReader(System.in));rn System.out.print("请选择符号(+、—、*、/):");rn BufferedReader brc = new BufferedReader(new InputStreamReader(System.in));rn qbrc = brc.toString();rn abr1 = br1.toString();rn abr2 = br2.toString();rn catch(Exception e)rn e.printStackTrace();rn System.err.println("操作有误,请重新操作!!!");rn rn tryrn qbr1 = Double.parseDouble(abr1);rn qbr2 = Double.parseDouble(abr2);rn rn rn catch(Exception e)rn e.printStackTrace();rn System.err.println("***"+abr1+abr2+"***");rn rn /*rn * 接口功能:进行相关运算并输出结果 rn * 接口输入:空 rn * 接口输出:空 rn */rn tryrn if(qbrc=="+")rn double resultOf = qbr1+qbr2;rn System.out.println("第一个数:"+abr1+"\n第二个数:"+abr2+"\n结果为:"+resultOf);rn rn if(qbrc=="-")rn double resultOf = qbr1-qbr2;rn System.out.println("第一个数:"+abr1+"\n第二个数:"+abr2+"\n结果为:"+resultOf);rn rn if(qbrc=="*")rn double resultOf = qbr1*qbr2;rn System.out.println("第一个数:"+abr1+"\n第二个数:"+abr2+"\n结果为:"+resultOf);rn rn if(qbrc=="/")rn double resultOf = qbr1/qbr2;rn System.out.println("第一个数:"+abr1+"\n第二个数:"+abr2+"\n结果为:"+resultOf);rn rn catch(Exception e)rn e.printStackTrace();rn System.err.println("**********\n您的除数不能为零!!!\n**********");rn rn rn rn rn /**rn * @param argsrn */rn public static void main(String[] args) rn Calculator calculator = new Calculator();rn calculator.sumT();rn rnrnrn
求大神解决啊
[img=https://img-bbs.csdn.net/upload/201404/09/1396994073_579690.png][/img]rn[img=https://img-bbs.csdn.net/upload/201404/09/1396994087_43546.png][/img]rn[img=https://img-bbs.csdn.net/upload/201404/09/1396994098_35274.png][/img]rn无法解决了,求大神看问题
求Web大神解决
业务场景:rn A系统提供一个JSP页面,该页面组织参数,提交到A系统后台一个Servlet查询数据。rn 现在A系统将这个JSP以及Js给B系统。(后台Servlet不给) rn B系统将JSP发布到自己的Web应用上,访问该JSP,提交数据,从而达到访问A系统的Servlet的目的。(业务需要不允许B系统直接访问A系统的Servlet,必须通过JSP来访问)rnrn实际现象:rn A、B系统在同一个企业内联网,但是属于不同的域下,AB系统也不是在一个地点发布的,A系统在A省,B系统在B省,B系统将A系统提供的jsp放到自己服务器的web应用上,B省的人员访问该JSP,点击提交访问A系统的Servlet。现在一直连接不到A系统的Servlet。 A省人员模拟该现象,自己新建一个新工程,将JSP拷贝进去,点击提交,是可以访问到A系统的Servlet的。rn 其他现象,B省人员直接在浏览器URL中输入A系统的Servlet地址,点击提交是可以访问到的,但是发布到B系统里面就访问不到了。按理说B省人员访问B系统JSP,实际上JS\JSP是已经下载到B人员本地浏览器里面的,Servlet请求实际上是B人员客户机发送请求给A系统Servlet的,如果B省人员可以直接访问Servlet,那么访问B系统JSP也应该能够访问到的。rn
sql求大神解决
[code=sql]with A_CODE asrn (select 'JACK' namea, '2' a, '1' b from dualrn union allrn select 'JACK' namea, '3' a, '2' b from dualrn union allrn select 'JACK' namea, '1' a, '3' b from dualrn union allrn select 'TOM' namea, '1' a, '1' b from dualrn union allrn select 'TOM' namea, '2' a, '2' b from dualrn union allrn select 'TOM' namea, '4' a, '3' b from dualrn union allrn select 'SAM' namea, '2' a, '1' b from dualrn union allrn select 'SAM' namea, '2' a, '2' b from dual)[/code]rnrn根据namea分组 求a/b 的值分别在0-1和1-2的列count值
菜鸟---==求大神~~~ 解决!!!
[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/1.gif][/img]如textbox1内容为rnrn[a1=zza][b1=c][c1=ddddw]eeee[/c1][/b1][/a1]rnrn要获取的内容是:rnrn [a1=zza]的内容【zza】,并输出到textbox2中;和[c1=ddddw]后面的内容【eee】输出到textbox3中;rnrn求大神 解决~~~ rnrn【那些都是变量】
相关热词 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池 c#5.0 安装程序 c# 分页算法