Android微信分享问题,求大神,感激不尽!

这是我的微信分享Activity。

因为这个程序直接运行在手机上,没有打包签名的,所以用官方的签名生成器生成的签名 也就是调试的签名来注册的 可以点了按钮分享 一点反应也没有 求解。谢谢!

 package com.chase.cn.demon;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.tencent.mm.sdk.modelmsg.SendMessageToWX;
import com.tencent.mm.sdk.modelmsg.WXMediaMessage;
import com.tencent.mm.sdk.modelmsg.WXWebpageObject;
import com.tencent.mm.sdk.openapi.IWXAPI;
import com.tencent.mm.sdk.openapi.WXAPIFactory;

/**
 * Created by Chase on 2016/12/16.
 */

public class ShareAppActivity extends Activity {

    private Button share_wx_friends;

    private IWXAPI wxApi;

    private void regToWx(){
        wxApi = WXAPIFactory.createWXAPI(this, "wxa69fbe409bcc2233");
        wxApi.registerApp("wxa69fbe409bcc2233");
    }



    private void wechatShare(int flag) {
        if (!wxApi.isWXAppInstalled()){
            Toast.makeText(getApplicationContext(),"您尚未安装微信客户端",Toast.LENGTH_SHORT).show();
            return;
        }


        WXWebpageObject webpage = new WXWebpageObject();
        webpage.webpageUrl = "http://baidu.com";
        WXMediaMessage msg = new WXMediaMessage(webpage);

        msg.title = "title";
        msg.description ="123";
        Bitmap thumb = BitmapFactory.decodeResource(getResources(),
                R.mipmap.splash_bgp);
        msg.setThumbImage(thumb);
        SendMessageToWX.Req req = new SendMessageToWX.Req();
        req.transaction = String.valueOf(System.currentTimeMillis());
        req.message = msg;
        req.scene = flag;
        wxApi.sendReq(req);
    }


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.share_app_activity);
        //实例化

        regToWx();

        share_wx_friends = (Button) findViewById(R.id.bt_share_wx_friends);
        share_wx_friends.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                wechatShare(1);
            }
        });
    }


}

2个回答

应用签名:fdf519eb242d732d4a7d82483ac10370
包名:com.chase.cn.demon

我是debug下的签名来生成的 用自己的keystore生成签名也试了 还是没反应

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
求大神指导,感激不尽。
我按书上给的源程序编译时却出现了错误。怎么了?下面是源代码:rn#include rnrnLRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;rnrnrnint WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,rn PSTR szCmdLine, int iCmdShow)rnrn static TCHAR szAppName[] = TEXT ("HelloWin") ;rn HWND hwnd ;rn MSG msg ;rn WNDCLASS wndclass ;rnrn wndclass.style = CS_HREDRAW | CS_VREDRAW ;rn wndclass.lpfnWndProc = WndProc ;rn wndclass.cbClsExtra = 0 ;rn wndclass.cbWndExtra = 0 ;rn wndclass.hInstance = hInstance ;rn wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;rn wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;rn wndclass.hbrBackground= (HBRUSH) GetStockObject (WHITE_BRUSH) ;rn wndclass.lpszMenuName = NULL ;rn wndclass.lpszClassName= szAppName ;rnrn if (!RegisterClass (&wndclass))rn rn MessageBox ( NULL, TEXT ("This program requires Windows NT!"),rn szAppName, MB_ICONERROR) ;rn return 0 ;rn rnrn hwnd = CreateWindow( szAppName, // window class namern TEXT ("Full Screen Display"), // window captionrn// WS_OVERLAPPEDWINDOW, // window stylern WS_POPUP,rn// CW_USEDEFAULT,// initial x positionrn// CW_USEDEFAULT,// initial y positionrn// CW_USEDEFAULT,// initial x sizern// CW_USEDEFAULT,// initial y sizern 0,rn 0,rn ::GetSystemMetrics(SM_CXSCREEN),rn ::GetSystemMetrics(SM_CYSCREEN),rn NULL, // parent window handlern NULL, // window menu handlern hInstance, // program instance handlern NULL) ; // creation parametersrnrnrn ShowWindow (hwnd, iCmdShow) ;rn UpdateWindow (hwnd) ;rnrnrn while (GetMessage (&msg, NULL, 0, 0))rn rn TranslateMessage (&msg) ;rn DispatchMessage (&msg) ;rn rn return msg.wParam ;rnrnrnLRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)rnrn HDC hdc ;rn PAINTSTRUCT ps ;rn RECT rect ;rnrn switch (message)rn rn case WM_CREATE:rn// PlaySound (TEXT ("hellowin.wav"), NULL, SND_FILENAME | SND_ASYNC) ;rn return 0 ;rn case WM_PAINT:rn hdc = BeginPaint (hwnd, &ps) ;rn GetClientRect (hwnd, &rect) ;rn DrawText (hdc, TEXT ("This window can cover the task item!"), -1, &rect,rn DT_SINGLELINE | DT_CENTER | DT_VCENTER) ;rn EndPaint (hwnd, &ps) ;rn return 0 ;rn case WM_DESTROY:rn PostQuitMessage (0) ;rn return 0 ;rn rn return DefWindowProc (hwnd, message, wParam, lParam) ;rnrn错误:rnCompiling...rn01.crne:\programs\a\01.c(33) : warning C4003: not enough actual parameters for macro 'CreateWindowA'rne:\programs\a\01.c(33) : warning C4047: 'function' : 'int ' differs in levels of indirection from 'void *'rne:\programs\a\01.c(33) : warning C4024: 'CreateWindowExA' : different types for formal and actual parameter 8rne:\programs\a\01.c(33) : warning C4133: 'function' : incompatible types - from 'struct HINSTANCE__ *' to 'struct HMENU__ *'rne:\programs\a\01.c(33) : error C2059: syntax error : ')'rne:\programs\a\01.c(43) : error C2143: syntax error : missing '' before '__stdcall'rne:\programs\a\01.c(44) : warning C4142: benign redefinition of typerne:\programs\a\01.c(51) : warning C4129: 'm' : unrecognized character escape sequencerne:\programs\a\01.c(51) : warning C4129: '? : unrecognized character escape sequencern执行 cl.exe 时出错.rnrn01.obj - 1 error(s), 0 warning(s)rn求大神指导
求大神帮忙、感激不尽。
rn 现在碰到如下问题 、 需要查询几个平台下的全部店铺 (一个平台下有若干个店铺) 、使用如下语句 。rnrn[code=sql]rnSELECTrn `paipai_shop`.`sellerUin` AS `shopId`,rn `paipai_shop`.`shopName` AS `shopName`rnFROMrn `paipai_shop`rnUNION ALLrn SELECTrn `dangdang_shop`.`id` AS `shopId`,rn `dangdang_shop`.`shopName` AS `shopName`rn FROMrn `dangdang_shop`rn UNION ALLrn SELECTrn `vjia_shop`.`id` AS `shopId`,rn `vjia_shop`.`shopName` AS `shopName`rn FROMrn `vjia_shop`rn UNION ALLrn SELECTrn `amazon_shop`.`id` AS `shopId`,rn `amazon_shop`.`shopName` AS `shopName`rn FROMrn `amazon_shop`rn UNION ALLrn SELECTrn `taobao_shop`.`shopId` AS `shopId`,rn `taobao_shop`.`nick` AS `shopName`rn FROMrn `taobao_shop`rn UNION ALLrn SELECTrn `jingd_shop`.`shopId` AS `shopId`,rn `jingd_shop`.`shopName` AS `shopName`rn FROMrn `jingd_shop`rn UNION ALLrn SELECTrn `yhd_shop`.`shopId` AS `shopId`,rn `yhd_shop`.`shopName` AS `shopName`rn FROMrn `yhd_shop`[/code]rn 查询出来后 、 因为不同平台下的店铺可能有相同的 shopId 、 导致页面上相同shopid的店铺只显示一个条数据 。 求有无解决方法 。 rn rn rn 我曾经尝试给不同平台下的店铺shopid 后面 拼接 数字 譬如 :[color=#FF0000]`yhd_shop`.`shopId`+0[/color] AS `shopId` 结果 没有用 。哪位大神给个解决方法?
求大神指教,小白感激不尽
#include n#include nusing namespace std;nint main()nn ofstream outf("test.dat");n char p[]="I am a student";n outf<>p;n cout<
求大神指教,菜鸟感激不尽!
#include nnusing namespace std;nclass Annpublic:n virtual void fun1()n n cout<<"Class A1\t";n n virtual void fun2(float x=0)n n cout<<"Class A2\n";n n;nclass B:public Annpublic:n virtual void fun1()n n cout<<"Class B1\t";n n virtual void fun2(int x=0)n n cout<<"Class B2\n";n n;nclass C:public Bnnpublic:n virtual void fun1()n n cout<<"Class B4:\t";n n virtual void fun2()n n cout<<"Class B3\n";n n;nint main()nn A *pa;n B *pb;n C c;n pa=&c;n pa->fun1();n pa->fun2();n pb=&c;n pb->fun1();n pb->fun2();n return 0;nn分析一下该程序的输出
winform 求大神 本人感激不尽
怎么在winform窗体导入一个地图,并且能计算地图两点间的距离
求大神指教,速回...感激不尽...
.Net 应用部署IIS之后,应用的login页面显示,但是输入用户名和密码之后,进入不了程序主页面,怎么回事?rn求大神指教///
求大神帮帮忙,妹子感激不尽
妹子是在校大三学生一枚,学的是ASP.NET开发,因为对专业不喜欢,所以大神你懂的,眼看本学期就要结束,12月初就要上交电子商务网站项目,在此,妹子跪求大神GG能够帮帮忙,能发给妹子一份完成的电子商务网站项目,邮箱:857670350@qq.com 坐等大神GG雪中送炭,感激不尽!!!
android蓝牙打印问题~求大神解答~小弟感激不尽
我已经可以用蓝牙正常连接上打印机(打印机型号是HP Officejet H470) 但是打印的是否没有内容~部知道为什么?
文件操作 出了问题 求大神指点 感激不尽
#includern#includernusing namespace std;rnstruct staffrnrn int num;rn char name[20];rn int age;rn double pay;rn;rnint main()rnrn staff staff[7]=1001,"wangli",25,1900,1003,"zhangsan",45,5800,1007,"susan",35,7800,rn 2002,"taoli",43,5665,2005,"zhanggong",33,3456,staff1;rn fstream iofile("staff.dat",ios::in|ios::out|ios::binary);rn if(!iofile)rn rn cerr<<"open error!"<>staff1.num>>staff1.name>>staff1.age>>staff1.pay;rn iofile.seekp(0,ios::end);rn iofile.write((char*)&staff1,sizeof(staff1));rn rn iofile.seekg(0,ios::beg);rn for(i=0;i<7;i++)rn rn iofile.read((char*)&staff[i],sizeof(staff[i]));rn cout<>num;rn while(num)rn rn find=false;rn iofile.seekg(0,ios::beg);rn for(i=0;i<7;i++)rn rn iofile.read((char*)&staff[i],sizeof(staff[i]));rn if(num==staff[i].num)rn rn m=iofile.tellg();rn cout<>num;rn rn iofile.close();rn return 0;rn
android 微信分享问题
一个项目基本完成了,微信分享的功能组长做好了,最近组长不在,发给了我一句话:“要用我给小明的那个key打包成正式版才可以分享”(小明是另一个人),这句话怎么理解?我个人没做过android微信分享这一块,所以想请教下大家~谢谢
Android 微信分享
这是一个微信分享的代码,可以分享文字、链接、视频,如果想详细了解,请参看微信开放平台,介绍,以及 注意的事项 首先需要在微信开放平台,注册app的app_ID; /** * Created by di.wang on 2018/6/25. */ public class WechatShareUtil { public static final String WECHAT_A...
android 微信分享
NULL 博文链接:https://1002878825-qq-com.iteye.com/blog/1765660
Android 微信分享
第三方集成步骤大致都差不多:平台注册,引入依赖包,配置清单文件,初始化操作,最后引用 注册就不用说了,直接上第三方官网,按照提示申请注册账号和应用,获取相应的appid,appkey等; 第一步:引入依赖包,项目build.gradle之下 compile 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+' 其中,里面的wi...
android微信分享
我用sharesdk分享,新浪微博和腾讯微博都能分享成功,微信总是分享失败,能打开微信客户端但是总是分享不成功,rn并且我的应用中信息包名、应用名称、打包生成的MD5跟在微信上注册的应用填写的一样,WXEntryActivity和sample例子中给的一样,appid 也是微信平台上应用的appid,可就是分享不了,求助啊,,,,,,,[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/83.gif][/img]rn
Android微信分享
注意:分享图片有限制,大小在32k之内,需要先压缩后分享 下载资源:https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1419319167&lang=zh_CN 对照开发文档拷贝SendToWXActivity类中的内容完成相应的诉求 “`
Android之微信分享
Android三步实现微信分享
微信分享-android
本例子是一个微信分享为好友,朋友圈,示例代码参考。
求大神解答,小白感激不尽啊
n n n n n n 这里怎么会有两个数据连接,没看明白啊
求大神赐于一条SQL,感激不尽
oracle有数据表是TrnDYEARMONTH PK_CORP CWAREHOUSEID CINVENTORYID CINVBASID VARrn2012-04 1002 1002F8100000000003ZA 0001A210000000008K16 0001F8100000000009ZZ 70rn2012-05 1002 1002F8100000000003ZA 0001A210000000008K16 0001F8100000000009ZZ -25rn2012-06 1002 1002F8100000000003ZA 0001A210000000008K16 0001F8100000000009ZZ -10rn2012-07 1002 1002F8100000000003ZA 0001A210000000008K16 0001F8100000000009ZZ 72rn2012-08 1002 1002F8100000000003ZA 0001A210000000008K16 0001F8100000000009ZZ -3rn2012-09 1002 1002F8100000000003ZA 0001A210000000008K16 0001F8100000000009ZZ -37rn2012-10 1002 1002F8100000000003ZA 0001A210000000008K16 0001F8100000000009ZZ -27rn2012-11 1002 1002F8100000000003ZA 0001A210000000008K16 0001F8100000000009ZZ -17rn2012-12 1002 1002F8100000000003ZA 0001A210000000008K16 0001F8100000000009ZZ 91rn2013-01 1002 1002F8100000000003ZA 0001A210000000008K16 0001F8100000000009ZZ -47rnrn现在想有一个类似递归的形式,以DYEARMONTH为条件,如2012-04这条数据VAR的值是本身(70),2012-05的数据为rn2012-04的var+上2012-05的var,70+(-25),一下类似,重新整理输出数据rnrnrn结果如:rn2012-04 1002 1002F8100000000003ZA 0001A210000000008K16 0001F8100000000009ZZ 70rn2012-05 1002 1002F8100000000003ZA 0001A210000000008K16 0001F8100000000009ZZ 45rn2012-06 1002 1002F8100000000003ZA 0001A210000000008K16 0001F8100000000009ZZ 35rn2012-07 1002 1002F8100000000003ZA 0001A210000000008K16 0001F8100000000009ZZ 107rn。。。。。。。。rnrn求高手解决,在线等,谢谢!!!rnrnrnrnrnrnrn
求各位大神帮帮我吧.....感激不尽
做个网站插件,没那方面的经验,不知怎么做啊。这插件的用途是:把插件安装到浏览器里,打开浏览器时,如果,我们公司的网站有信息更新了,就在浏览器内弹个广告窗出来,显示更新的信息,点击可连接到我们公司的网站即可.(兼容狐火和谷歌就行).
Linux C编程求大神帮忙,感激不尽
rnrn void Detect_4G_model(void *param)rn rn while(1) rn / 检测到插入模块 */rn g_4g_status = RUN;rnrn /* 检测到拔出模块 */rn g_4g_status = STOP;rn rnrn rn void Send_to_4g_thread(void *param)rn rn / 下面是需要挂起和唤醒的部分*/rn while(1) rnrn /* .... */rn rnrn return NULL;rn rnrn int main(int argc, char * argv[])rn rn pthread_create(&tid1, NULL, Detect_4G_model, NULL);rn pthread_create(&tid2, NULL, Send_to_4g_thread, NULL);rn rn 程序有两个线程,线程td1用来检测外部模块的插入和拔出,当检测到拔出时,g_4g_status 设置为 STOP;当检测到插入时,g_4g_status 设置为RUN, 请问,怎么根据g_4g_status 的状态来控制线程Send_to_4g_thread的挂起和唤醒,最好写出点代码,O(∩_∩)O谢谢rn
求大神帮忙,高手赐教,小白感激不尽
题目:nn绘制金字塔(4分)n题目内容:n要求用户从键盘输入一个大写字母,使用嵌套循环产生像下面这样的金字塔图案:n    An   ABAn  ABCBAn ABCDCBAnn程序运行结果示例1:nPlease input a capital:nD↙n____An___ABAn__ABCBAn_ABCDCBAn程序运行结果示例2:nPlease input a capital:nF↙n______An_____ABAn____ABCBAn___ABCDCBAn__ABCDEDCBAn_ABCDEFEDCBAn(说明:上面运行结果示例中,每行字母前面的下划线"_"代表屏幕上实际输出的是空格,最后一行前面有一个空格,倒数第二行有两个空格,以此类推。)nn输入提示信息:"Please input a capital:\n"n输入格式: "%c"n输出格式:"%c"n为避免出现格式错误,请直接拷贝粘贴题目中给的格式字符串和提示信息到你的程序中。n小白的程序:n#includenint main()nn char m,n;n n='A';n int i,k;n printf("Please input a capital:\n");n scanf("%c",&m);n for(i=1;i<=(int)m-(int)n;i++)n n for(k=(int)n;k<=(int)m-(int)n-i+1;k++)n n printf(" ");n n for(k=(int)n;k<=(int)n+i-1;k++)n n printf("%c",k);n n for(k=(int)n+i-2;k<=(int)n;k--)n n printf("%c",k);n n for(k=(int)n;k<=(int)m-(int)n-i+1;k++)n n printf(" ");n n printf("\n");nnn为什么运行的时候乱码了?n求大神赐教。
求看大神看下 oracle 存储过程 感激不尽
准备在java中调用 用游标返回的存储过程 这个在pl/sql中显示这个存储过程是有问题的,begin中的sql语句 拿出来是可以以用的 只不过放在存储过程里面时候是把 固定的值 换成了参数 不知道哪里错了,希望大神帮看看nnCREATE OR REPLACE PACKAGE TOLL_PATH_PACKAGE ISn --动态游标n TYPE REFCURSOR IS REF CURSOR;nEND TOLL_PATH_PACKAGE;nnCREATE OR REPLACE PROCEDURE TOLL_PATH_LENGTH ASn( n CUR_RET OUT TOLL_PATH_PACKAGE.REFCURSOR,n IN_LINK IN NUMBER, --起始n OUT_LINK IN NUMBER --目的n)nISnBEGINn OPEN CUR_RET FORn with T (LINK_PID,S_NODE_PID,E_NODE_PID,tollpath,LENGTH,lvl) as (n select LINK_PID,n S_NODE_PID,n E_NODE_PID,n '/'||LINK_PID as tollpath,n LENGTH,n 1 as lvln from rd_link123n where LINK_PID = IN_LINK --起始n union alln select r.link_pid,n r.s_node_pid,n r.e_node_pid,n t.tollpath||'/'||r.link_pid,n t.length + r.length,n t.lvl + 1n from t,rd_link123 rn where r.s_node_pid = t.e_node_pidn and IN_LINK<> r.e_node_pid --不能转回来n and t.link_pid <>OUT_LINK --目的地n and lvl <400n and instr(t.tollpath,'/'||r.link_pid)=0n)nselect t.link_pid,to_clob(t.tollpath||'/') path,t.length nfrom T where LINK_PID=OUT_LINK;nEXCEPTIONn WHEN OTHERS THENn dbms_output.put_line('出错了');nEND TOLL_PATH_LENGTH;n
mysql启动不了,求大神指点,感激不尽!
2017-10-09T01:42:06.484929Z mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid endedrn2017-10-09T01:42:42.000990Z mysqld_safe Starting mysqld daemon with databases from /opt/mysql/datarn2017-10-09T01:42:42.157912Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).rn2017-10-09T01:42:42.157977Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabledrn2017-10-09T01:42:42.157996Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.16-log) starting as process 21895 ...rn2017-10-09T01:42:42.161194Z 0 [Note] InnoDB: PUNCH HOLE support not availablern2017-10-09T01:42:42.161213Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtinsrn2017-10-09T01:42:42.161216Z 0 [Note] InnoDB: Uses event mutexesrn2017-10-09T01:42:42.161220Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrierrn2017-10-09T01:42:42.161228Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3rn2017-10-09T01:42:42.161230Z 0 [Note] InnoDB: Using Linux native AIOrn2017-10-09T01:42:42.161378Z 0 [Note] InnoDB: Number of pools: 1rn2017-10-09T01:42:42.161442Z 0 [Note] InnoDB: Using CPU crc32 instructionsrn2017-10-09T01:42:42.181498Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128Mrn2017-10-09T01:42:42.186230Z 0 [Note] InnoDB: Completed initialization of buffer poolrn2017-10-09T01:42:42.187139Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().rn2017-10-09T01:42:55.945202Z 0 [Warning] InnoDB: 1048576 bytes should have been read. Only 917504 bytes read. Retrying for the remaining bytes.rn2017-10-09T01:43:09.891588Z 0 [Warning] InnoDB: Retry attempts for reading partial data failed.rn2017-10-09T01:43:10.079210Z 0 [ERROR] InnoDB: [b]Tried to read 1048576 bytes at offset 2097152, but was only able to read 917504[/b]rn2017-10-09T01:43:10.079224Z 0 [ERROR] InnoDB: Operating system error number 5 in a file operation.rn2017-10-09T01:43:10.079236Z 0 [ERROR] InnoDB: Error number 5 means 'Input/output error'rn2017-10-09T01:43:10.079241Z 0 [Note] InnoDB: Some operating system error numbers are described at http://dev.mysql.com/doc/refman/5.7/en/operating-system-error-codes.htmlrn2017-10-09T01:43:10.079246Z 0 [ERROR] InnoDB: File (unknown): 'read' returned OS error 105. Cannot continue operationrn2017-10-09T01:43:10.079250Z 0 [ERROR] InnoDB: Cannot continue operation.rn2017-10-09T01:43:10.384121Z mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
求各位大神进来瞧一下,感激不尽
为什么写成一行就变成11和7了?不是应该都是7吗?(指针p指向a[3]?先输出a[3]=7啊?再输出(*p++),先输出*p也就是a[3]=7,然后p自增,指向下一个元素,也就是a[4],为什么不是这样呢?)有大神指导一下吗?感谢感谢!rnrn程序代码rn#include rnrnusing namespace std;rnrnstatic int a[]=1,3,5,7,11,13;rnint main()rnrn int *p;rn p=a+3;rn cout<<*p<<'\t'<<(*p++)<rnrnusing namespace std;rnrnstatic int a[]=1,3,5,7,11,13;rnint main()rnrn int *p;rn p=a+3;rn cout<<*p<<'\t';rn cout<<(*p++)<
急急急,求大神指点,感激不尽
[code=java]public View getView(int paramInt, View v, ViewGroup paramViewGroup) rn ViewHolder vh;rn if(v == null) rn v = LayoutInflater.from(mActivity).inflate(R.layout.view_list_configures, null);rn vh = new ViewHolder();rn vh.textView = (TextView)v.findViewById(R.id.configures_text);rn vh.ivImage = (ImageView)v.findViewById(R.id.configures_check_img);rn v.setTag(vh);rn label62: if(paramInt != 0)rn break label124;--冒号报错rn v.setBackgroundResource(R.drawable.no_rect_bg_selector);rn label72: vh.textView.setText((CharSequence)itemsText.get(paramInt));rn if(this.selectIndex != paramInt)rn break label158;--冒号报错rn vh.ivImage.setVisibility(View.VISIBLE);rn rn while(true) rn return v;rn vh = (ViewHolder)v.getTag();rn break label62:rn if(paramInt == -1 + this.itemsText.size())rn label124: v.setBackgroundResource(R.drawable.bottom_rect_bg_selector);rn break label72:rn label158: vh.ivImage.setVisibility(View.VISIBLE); rn rn rnrn public class ViewHolder rn public TextView textView;rn public ImageView ivImage;rnrn public ViewHolder()rn rn [/code]rnrn这两个冒号总是报错,我用是eclipse,错误代码:[color=#FF0000]Syntax error on token ":", ; expected[/color]rn我改为分号也不对,报错的更多,求大神指导,这块break label的代码是什么意思?
一个纠结的异常,求大神指点!!!!感激不尽!!!!
最近在搞一个推送程序,基于开源程序android pn ,我的程序在本地(windows7系统)能够正常运行,但是丢到服务器上面去之后每次都报如下异常,有没有人遇到过这种情况啊,本人对Spring架构不是很了解,好心人帮我解决一下![code=java]ERROR [2014-01-14 20:12:50,870] : Context initialization failedrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlMapping' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'notificationController' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.androidpn.server.console.controller.NotificationController]: Constructor threw exception; nested exception is java.lang.NullPointerExceptionrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)rn at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)rn at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)rn at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)rn at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)rn at javax.servlet.GenericServlet.init(GenericServlet.java:160)rn at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)rn at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)rn at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1120)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1678)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)rn at java.util.concurrent.FutureTask.run(FutureTask.java:262)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)rn at java.lang.Thread.run(Thread.java:744)rnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'notificationController' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.androidpn.server.console.controller.NotificationController]: Constructor threw exception; nested exception is java.lang.NullPointerExceptionrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rn at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)rn at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:297)rn at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129)rn at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:103)rn at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)rn at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:69)rn at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)rn at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:70)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)rn ... 32 morernCaused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.androidpn.server.console.controller.NotificationController]: Constructor threw exception; nested exception is java.lang.NullPointerExceptionrn at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)rn at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)rn ... 53 morernCaused by: java.lang.NullPointerExceptionrn at org.androidpn.server.xmpp.XmppServer.getBean(XmppServer.java:114)rn at org.androidpn.server.service.ServiceLocator.getNotificationService(ServiceLocator.java:53)rn at org.androidpn.server.xmpp.push.NotificationManager.(NotificationManager.java:61)rn at org.androidpn.server.console.controller.NotificationController.(NotificationController.java:39)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:526)rn at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)rn ... 55 morern[/code]
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问题,求大神解答
为什么会这样![图片](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什么关系
Android 问题,求大神解决!
06-29 10:49:34.195 23540-23540/com.ziyeyanhuo.assetmanagement E/AndroidRuntime: FATAL EXCEPTION: mainn Process: com.ziyeyanhuo.assetmanagement, PID: 23540n java.lang.RuntimeException: Unable to start activity ComponentInfocom.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 referencen at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2466)n at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2528)n at android.app.ActivityThread.access$800(ActivityThread.java:169)n at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)n at android.os.Handler.dispatchMessage(Handler.java:111)n at android.os.Looper.loop(Looper.java:194)n at android.app.ActivityThread.main(ActivityThread.java:5552)n at java.lang.reflect.Method.invoke(Native Method)n at java.lang.reflect.Method.invoke(Method.java:372)n at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964)n at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)n 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 referencen at com.ziyeyanhuo.assetmanagement.MainActivity.onCreate(MainActivity.java:54)n at android.app.Activity.performCreate(Activity.java:5975)n at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1111)n at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2419)n at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2528) n at android.app.ActivityThread.access$800(ActivityThread.java:169) n at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421) n at android.os.Handler.dispatchMessage(Handler.java:111) n at android.os.Looper.loop(Looper.java:194) n at android.app.ActivityThread.main(ActivityThread.java:5552) n at java.lang.reflect.Method.invoke(Native Method) n at java.lang.reflect.Method.invoke(Method.java:372) n at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964) n at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759) n
相关热词 c# login 居中 c# 考试软件 c# 自然语言分析 c# 分段读取文件 c# 泛型反射 c#打断点 c# 时间转多少秒 c# 线程函数加参数 c# modbus 读取 c#查询集合表