Android Question please help i have problem in Manifest

Status
Not open for further replies.

naifnas

Active Member
Licensed User
hi all
i try nbdemo
but show problem this

B4A Version: 7.30
Parsing code. (0.01s)
Compiling code. (0.13s)
Compiling layouts code. (0.03s)
Organizing libraries. (0.04s)
Generating R file. Error
AndroidManifest.xml:30: error: No resource identifier found for attribute 'parentActivityName' in package 'android'
-----------------------------------------
this Manifest
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="17"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)

SetActivityAttribute(NotePopup, androidarentActivityName, ".NoteParent")
SetActivityAttribute(NotePopup, android:launchMode, "standard")
AddActivityText(NotePopup,<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".NoteParent"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
-------------------------------------------
please any help me?
thanks
 

naifnas

Active Member
Licensed User
Thanks..I already update all ..still problem..
Anyway I try this code but when I click Button not Event

Some friend correct this code
I need this
B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
   
    Dim nb As NotificationBuilder
    Dim nbBigTextStyle As NotificationBigTextStyle

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private Panel1 As Panel
    Private Button1 As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.Title = "Test - Main Activity"
    Panel1.Initialize("")
    Activity.AddView(Panel1,0,0,100%x,100%y)
    Panel1.LoadLayout("1")
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub



Sub Button1_Click
    nb.Initialize
    nb.SmallIcon = "icon"
    nb.Ticker = "test app"
    nb.Tag="some tag"
    nb.setActivity(Me)
    nb.DefaultLight=True
    nb.DefaultVibrate=True
    nb.DefaultSound=True
    nb.ContentTitle="aaa"
    nb.ContentText="aaaa"
    nb.ContentInfo="aaaaaa"
    nb.SubText="ss"
    nb.Notify(1)
End Sub

Thanks and I am sorry if disturbe you
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
If you are referring to the sample you attached (NBDemo.zip) it works, what do you mean by "when I click Button not Event"?, that demo allows you to select several choices and it will trigger a notification when you tap on the button at the bottom of the screen (Notification is active).

If you have created your own code, then ZIP it and post it here.
 
Upvote 0

naifnas

Active Member
Licensed User
This another code
I try easy code
B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
  
    Dim nb As NotificationBuilder
    Dim nbBigTextStyle As NotificationBigTextStyle

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private Panel1 As Panel
    Private Button1 As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.Title = "Test - Main Activity"
    Panel1.Initialize("")
    Activity.AddView(Panel1,0,0,100%x,100%y)
    Panel1.LoadLayout("1")
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub



Sub Button1_Click
    nb.Initialize
    nb.SmallIcon = "icon"
    nb.Ticker = "test app"
    nb.Tag="some tag"
    nb.setActivity(Me)
    nb.DefaultLight=True
    nb.DefaultVibrate=True
    nb.DefaultSound=True
    nb.ContentTitle="aaa"
    nb.ContentText="aaaa"
    nb.ContentInfo="aaaaaa"
    nb.SubText="ss"
    nb.Notify(1)
End Sub
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
Well, I asked you to Export to ZIP and attach it because that's easier to test, but anyway, I have a few questions for you?

- What is in Layout 1?
- Why are you initializing that panel? Why is not part of your layout?

Like I mentioned above, Export your code as ZIP and attach it, you can do that using the IDE.
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
Ok, well, you are doing it wrong, your Activity_Create should look like this:
B4X:
Sub Activity_Create(FirstTime As Boolean)

    Activity.LoadLayout("1")
				
End Sub
Also, if you are using the designer, keep using the designer, do not mix things or problems like this might arise.

It is better that you keep the UI separated from the logic, in other words, use the designer to create your layouts and avoid creating views by code.
 
Upvote 0

naifnas

Active Member
Licensed User
I try setting mobile to default setting
it same nothing
this log
B4X:
Logger connected to:  samsung SM-N920C
--------- beginning of main
--------- beginning of system
Copying updated assets files (1)
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.NoSuchMethodError: No virtual method setSubText(Ljava/lang/CharSequence;)Landroid/support/v4/app/NotificationCompat$Builder; in class Landroid/support/v4/app/NotificationCompat$Builder; or its super classes (declaration of 'android.support.v4.app.NotificationCompat$Builder' appears in /data/app/test.com-1/base.apk)
    at barxdroid.NotificationBuilder.NotificationBuilder.setSubText(NotificationBuilder.java:295)
    at test.com.main._button1_click(main.java:439)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
    at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
    at android.view.View.performClick(View.java:5697)
    at android.widget.TextView.performClick(TextView.java:10815)
    at android.view.View$PerformClick.run(View.java:22526)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:158)
    at android.app.ActivityThread.main(ActivityThread.java:7229)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
 
Upvote 0
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…